/* ========== RESET & ROOT COLOR THEME ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --clr-primary: #fff;
    --clr-secondary: #003c6d;
    --clr-accent: #fe8c07;
    --clr-text: #444;
    --clr-muted: #777;
    --clr-light: #f7f7f7;
    --clr-secondary-light: #e6f0f9;
    --clr-accent-light: #fff3e6;
    --clr-border: #e0e0e0;
    --clr-shadow: rgba(0, 60, 109, 0.1);
    --clr-overlay: rgba(0, 0, 0, 0.5);
}

body {
    background: var(--clr-light);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    color: var(--clr-text);
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--clr-light);
}
::-webkit-scrollbar-thumb {
    background: var(--clr-accent);
    border-radius: 10px;
}

.predictor-wrapper {
    max-width: 1100px;
    margin: 30px auto 0;
}

/* Header */
.academy-header {
    background: var(--clr-primary);
    border-radius: 24px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px var(--clr-shadow);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--clr-border);
}

.brand-section {
    flex: 1;
}

.academy-logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--clr-secondary);
    margin-bottom: 0.25rem;
}

.academy-logo span {
    color: var(--clr-accent);
}

.academy-tagline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.tagline-text {
    font-size: 0.75rem;
    color: var(--clr-muted);
    letter-spacing: 0.5px;
}

.excellence-badge {
    background: var(--clr-secondary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--clr-secondary);
    border-left: 2px solid var(--clr-accent);
}

.status-area {
    text-align: right;
}

.sync-status {
    font-size: 0.7rem;
    padding: 0.4rem 1rem;
    background: var(--clr-light);
    border-radius: 30px;
    display: inline-block;
    color: var(--clr-muted);
    border: 1px solid var(--clr-border);
}

.pnav-link {
    font-size: 0.8rem;
    color: var(--clr-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 0.5rem;
}

.pnav-link:hover {
    color: var(--clr-accent);
}

/* Predictor Card */
.predictor-card {
    background: var(--clr-primary);
    border-radius: 28px;
    border: 1px solid var(--clr-border);
    overflow: hidden;
    box-shadow: 0 20px 40px var(--clr-shadow);
}

.card-header {
    background: linear-gradient(135deg, var(--clr-secondary-light) 0%, var(--clr-primary) 100%);
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--clr-secondary);
    text-transform: uppercase;
}

.ai-badge {
    background: var(--clr-accent-light);
    padding: 0.3rem 0.9rem;
    border-radius: 30px;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: monospace;
    border: 1px solid var(--clr-accent);
    color: var(--clr-accent);
}

.card-body {
    padding: 2rem;
}

/* Shift Selector */
.shift-section {
    margin-bottom: 2rem;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--clr-muted);
    margin-bottom: 0.75rem;
    display: block;
}

.shift-select {
    width: 100%;
    background: var(--clr-primary);
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    padding: 0.9rem 1.2rem;
    color: var(--clr-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.shift-select:hover, .shift-select:focus {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px rgba(254, 140, 7, 0.1);
}

/* Prediction Row */
.prediction-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    flex: 2;
    min-width: 200px;
    background: var(--clr-primary);
    border-radius: 20px;
    border: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px rgba(254, 140, 7, 0.1);
}

.score-input {
    background: transparent;
    border: none;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    color: var(--clr-text);
    width: 100%;
    outline: none;
    font-weight: 500;
}

.score-input::placeholder {
    color: var(--clr-muted);
}

.predict-btn {
    background: var(--clr-accent);
    border: none;
    margin: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: 16px;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--clr-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
}

.predict-btn:hover {
    background: #e67e00;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(254, 140, 7, 0.4);
}

.predict-btn:active {
    transform: translateY(0);
}

.percentile-card {
    flex: 1;
    min-width: 160px;
    background: var(--clr-secondary-light);
    border-radius: 20px;
    border: 1px solid var(--clr-border);
    text-align: center;
    padding: 1rem;
}

.percentile-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--clr-secondary);
    margin-bottom: 0.5rem;
}

.percentile-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--clr-accent);
    line-height: 1.2;
}

.worst-case-section {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: baseline;
}

.worst-case-label {
    color: var(--clr-muted);
}

.worst-case-value {
    color: #e67e22;
    font-weight: bold;
}

.hidden {
    display: none;
}

/* Target Scores Grid */
.targets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--clr-border);
}

.target-item {
    background: var(--clr-light);
    border-radius: 20px;
    text-align: center;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--clr-border);
}

.target-item:hover {
    border-color: var(--clr-accent);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--clr-shadow);
}

.target-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.target-title.p99 {
    color: #e65c4a;
}

.target-title.p98 {
    color: #f0a34b;
}

.target-title.p90 {
    color: var(--clr-accent);
}

.target-score {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: monospace;
    color: var(--clr-secondary);
}

.footnote {
    margin-top: 1.5rem;
    font-size: 0.65rem;
    color: var(--clr-muted);
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--clr-border);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--clr-overlay);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lead-modal {
    background: var(--clr-primary);
    border-radius: 28px;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--clr-border);
}

.modal-overlay.active .lead-modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--clr-muted);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--clr-accent);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--clr-secondary);
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: var(--clr-muted);
    font-size: 0.85rem;
}

.call-now {
    background: var(--clr-accent-light);
    padding: 1rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--clr-accent);
}

.call-now .p-phone {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--clr-accent);
    text-decoration: none;
}

.divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--clr-border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: var(--clr-primary);
    padding: 0 1rem;
    color: var(--clr-muted);
    font-size: 0.8rem;
}

.divider-text {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--clr-secondary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px rgba(254, 140, 7, 0.1);
}

.submit-lead {
    width: 100%;
    background: var(--clr-secondary);
    color: var(--clr-primary);
    border: none;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.submit-lead:hover {
    background: var(--clr-accent);
    transform: translateY(-2px);
}

.submit-lead:disabled {
    background: var(--clr-muted);
    cursor: not-allowed;
    transform: none;
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    width: 100%;
    max-width: 420px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-slds-toast {
    background: var(--clr-primary);
    border-left: 4px solid var(--clr-accent);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 680px) {
    body {
        padding: 1rem;
    }
    .card-body {
        padding: 1.2rem;
    }
    .prediction-row {
        flex-direction: column;
    }
    .targets-grid {
        gap: 0.8rem;
    }
    .target-score {
        font-size: 1.2rem;
    }
    .percentile-value {
        font-size: 1.6rem;
    }
    .academy-header {
        flex-direction: column;
        text-align: center;
    }
    .status-area {
        text-align: center;
    }
    .lead-modal {
        padding: 1.5rem;
    }
}