/* ============================================================
   ISS PASS PREDICTOR — Tool-specific styles
   Builds on top of shared.css design system
   ============================================================ */

/* --- PAGE LAYOUT --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    position: relative;
}

.iss-hero {
    text-align: center;
    margin-bottom: var(--space-6);
}

.iss-hero h1 {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
}

.iss-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    margin: 0;
}

.version {
    position: absolute;
    top: 0;
    right: var(--space-4);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* --- CONTROLS & INPUTS --- */
.location-section, .date-section {
    background: var(--bg-surface);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}

h2 {
    font-family: var(--font-display);
    color: var(--color-blue-200);
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--color-blue-400);
    box-shadow: var(--shadow-glow-blue);
}

.manual-location {
    margin-top: var(--space-4);
}

.manual-location label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

input[type="number"], input[type="date"] {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    margin-right: var(--space-3);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="number"]:focus, input[type="date"]:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.location-display {
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: rgba(30, 91, 184, 0.08);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--color-blue-200);
    font-size: var(--text-sm);
    display: none;
}

.location-display.active {
    display: block;
}

.loading, .error {
    text-align: center;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.loading {
    color: var(--color-blue-300);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 500;
}

.error {
    background: rgba(239, 68, 68, 0.08);
    color: var(--color-red-400);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* --- RESULTS HEADER & TOGGLES --- */
.sort-toggle-container {
    display: flex;
    gap: 2px;
    margin-bottom: var(--space-6);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 2px;
}

.sort-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.sort-btn:hover {
    color: var(--text-primary);
}

.sort-btn.active {
    background: rgba(30, 91, 184, 0.2);
    color: var(--color-blue-300);
    box-shadow: var(--shadow-sm);
}

.passes-intro {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
}

.prediction-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--color-amber-500);
    color: var(--color-gold-300);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
}

.no-passes {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--space-10);
    font-size: var(--text-lg);
}

/* --- NEWBIE EXPLAINER --- */
.newbie-explainer {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.newbie-explainer-header {
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    color: var(--color-blue-200);
    font-family: var(--font-display);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background var(--transition-fast);
}

.newbie-explainer-header:hover {
    background: var(--bg-surface-hover);
}

.newbie-explainer-body {
    padding: 0 var(--space-5) var(--space-5) var(--space-5);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    display: none;
}

.newbie-explainer-body p {
    margin-top: var(--space-3);
}

.newbie-explainer-body strong {
    color: var(--text-heading);
}

/* --- PASS CARDS --- */
.iss-cache-note {
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-gold-400);
    margin-bottom: var(--space-4);
    text-align: center;
}

.pass-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    border-left: 4px solid var(--border-strong);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--border-strong);
    position: relative;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.pass-card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-lg);
}

.best-pass-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-gold-500), var(--color-gold-300));
    color: #1a1000;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-glow-gold);
}

.pass-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.pass-date {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--color-blue-300);
    font-weight: 600;
}

.pass-duration-pill {
    background: var(--bg-surface-raised);
    color: var(--text-secondary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 600;
    border: 1px solid var(--border-default);
}

/* Callout Box */
.brightness-callout {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 500;
    font-size: var(--text-sm);
}

.brightness-callout .icon {
    font-size: var(--text-xl);
    flex-shrink: 0;
}

/* 4-Column Grid */
.pass-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.detail-item {
    background: var(--bg-surface-raised);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-subtle);
}

.detail-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    font-size: var(--text-lg);
    color: var(--text-heading);
    font-weight: 700;
    font-family: var(--font-display);
}

/* Calendar Button */
.calendar-btn {
    display: block;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
    transition: all var(--transition-fast);
}

.calendar-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-heading);
    border-color: var(--border-strong);
}

/* Help Find Buttons */
.help-find-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--color-blue-600);
    color: var(--color-blue-300);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.help-find-btn:hover {
    background: rgba(30, 91, 184, 0.1);
    border-color: var(--color-blue-400);
}

.find-it-tooltip {
    margin-top: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--color-blue-600);
    border-radius: var(--radius-md);
    background: rgba(30, 91, 184, 0.05);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
}

.find-it-tooltip strong {
    color: var(--color-blue-200);
}

/* --- BRIGHTNESS VARIANTS --- */
.pass-card.spectacular {
    border-left-color: var(--color-gold-500);
    border-color: rgba(212, 160, 23, 0.25);
    border-left: 4px solid var(--color-gold-500);
    box-shadow: var(--shadow-glow-gold);
}
.pass-card.spectacular .brightness-callout {
    background: rgba(212, 160, 23, 0.1);
    color: var(--color-gold-300);
}

.pass-card.very-bright {
    border-left-color: var(--color-blue-400);
    border-left: 4px solid var(--color-blue-400);
}
.pass-card.very-bright .brightness-callout {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-blue-200);
}

.pass-card.bright {
    border-left-color: var(--color-blue-300);
    border-left: 4px solid var(--color-blue-300);
}
.pass-card.bright .brightness-callout {
    background: rgba(96, 165, 250, 0.08);
    color: var(--color-blue-100);
}

.pass-card.moderate {
    border-left-color: var(--border-strong);
    border-left: 4px solid var(--border-strong);
}
.pass-card.moderate .brightness-callout {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-secondary);
}

.pass-card.faint, .pass-card.very-faint {
    border-left-color: var(--color-amber-500);
    border-left: 4px solid var(--color-amber-500);
}
.pass-card.faint .brightness-callout, .pass-card.very-faint .brightness-callout {
    background: rgba(245, 158, 11, 0.08);
    color: var(--color-gold-300);
}

/* Satellite name label on cards */
.pass-card > div:first-child[style*="color:#93c5fd"] {
    font-family: var(--font-display);
}

/* --- SATELLITE SECTION --- */
.satellite-section label {
    display: block;
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
}

.satellite-section input[type="checkbox"] {
    margin-right: var(--space-2);
    accent-color: var(--color-blue-400);
    width: 16px;
    height: 16px;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .pass-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .manual-location input {
        width: 100%;
        margin-bottom: var(--space-3);
        margin-right: 0;
    }

    .iss-hero h1 {
        font-size: var(--text-3xl);
    }

    .pass-date {
        font-size: var(--text-base);
    }

    .pass-date-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

@media (max-width: 400px) {
    .container {
        padding: 0 var(--space-3);
    }

    .location-section, .date-section {
        padding: var(--space-4);
    }

    .pass-card {
        padding: var(--space-4);
    }

    .detail-value {
        font-size: var(--text-base);
    }
}
