/* style.css - Modern Glassmorphism Styling for SMAN 2 Prabumulih PPDB Verification */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Variables (Dark Mode by Default) */
    --bg-primary: #080b11;
    --bg-secondary: #0f1524;
    --bg-gradient-1: #090e1a;
    --bg-gradient-2: #151e33;
    
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --success-glow: rgba(16, 185, 129, 0.25);
    --success-border: rgba(16, 185, 129, 0.3);
    
    --warning: #f59e0b;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --warning-glow: rgba(245, 158, 11, 0.25);
    --warning-border: rgba(245, 158, 11, 0.3);
    
    --danger: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --danger-glow: rgba(239, 68, 68, 0.25);
    --danger-border: rgba(239, 68, 68, 0.3);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Light Theme Overrides */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-gradient-1: #f1f5f9;
    --bg-gradient-2: #e2e8f0;
    
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(15, 23, 42, 0.08);
    --card-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.1);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(59, 130, 246, 0.25);
    
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --success-glow: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.2);
    
    --warning: #d97706;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    --warning-glow: rgba(217, 119, 6, 0.15);
    --warning-border: rgba(217, 119, 6, 0.2);
    
    --danger: #dc2626;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --danger-glow: rgba(220, 38, 38, 0.15);
    --danger-border: rgba(220, 38, 38, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    background-image: radial-gradient(at 0% 0%, var(--bg-gradient-1) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, var(--bg-gradient-2) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.5;
    transition: var(--transition-smooth);
}

/* Header Utilities */
header {
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon svg {
    width: 26px;
    height: 26px;
    fill: #ffffff;
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.theme-toggle-btn .sun-icon {
    display: none;
}

body.light-theme .theme-toggle-btn .moon-icon {
    display: none;
}

body.light-theme .theme-toggle-btn .sun-icon {
    display: block;
}

/* Container & Main App Layout */
main {
    flex: 1;
    width: 100%;
    max-width: 720px;
    padding: 0 24px 48px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
}

.app-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.card-title {
    text-align: center;
    margin-bottom: 28px;
}

.card-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-title p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 auto;
}

/* Search Form */
.search-form {
    position: relative;
    margin-bottom: 12px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon-left {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.search-icon-left svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.search-input {
    width: 100%;
    padding: 18px 120px 18px 56px;
    background: rgba(15, 23, 42, 0.4);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-lg);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    outline: none;
}

body.light-theme .search-input {
    background: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: rgba(15, 23, 42, 0.6);
}

body.light-theme .search-input:focus {
    background: #ffffff;
}

.search-input:focus ~ .search-icon-left {
    color: var(--primary);
}

/* Form Action Buttons */
.clear-btn {
    position: absolute;
    right: 90px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.clear-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

body.light-theme .clear-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.clear-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.search-btn {
    position: absolute;
    right: 8px;
    height: calc(100% - 16px);
    padding: 0 20px;
    background: var(--primary-gradient);
    border: none;
    border-radius: calc(var(--radius-lg) - 6px);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px var(--primary-glow);
    transition: var(--transition-smooth);
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
    filter: brightness(1.1);
}

.search-btn:active {
    transform: translateY(1px);
}

.secondary-btn {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

.secondary-btn:hover {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    filter: none !important;
}

.input-helper {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 8px;
    padding-left: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-helper svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Mock Warning Banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px dashed var(--warning-border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    color: var(--warning);
    font-size: 0.82rem;
    font-weight: 500;
    animation: fadeIn 0.4s ease;
}

.status-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Results Card Styling */
.result-container {
    display: none; /* Controlled by JS */
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.student-card {
    border-top: 1px solid var(--card-border);
    padding-top: 32px;
    margin-top: 8px;
}

/* Student Bio Profile Header */
.student-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-badge {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}

/* Stepper Section (Visual flow of checkpoints) */
.stepper {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 36px;
    position: relative;
}

/* Vertical line behind stepper steps */
.stepper::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 20px;
    bottom: 20px;
    width: 3px;
    background: var(--card-border);
    z-index: 1;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    z-index: 2;
}

.step-node {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 700;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.step-node svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: none;
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    transition: var(--transition-smooth);
}

.step-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Dynamic Step Status States */
/* 1. SUCCESS / PASSED STATE */
.step.state-success .step-node {
    background: var(--success-gradient);
    border-color: var(--success);
    color: white;
    box-shadow: 0 0 16px var(--success-glow);
}
.step.state-success .step-node svg.icon-success {
    display: block;
}
.step.state-success .step-node span {
    display: none;
}
.step.state-success .step-title {
    color: var(--success);
}
.step.state-success .step-desc {
    color: var(--text-secondary);
}

/* 2. PENDING / IN-PROGRESS STATE */
.step.state-pending .step-node {
    background: var(--warning-gradient);
    border-color: var(--warning);
    color: white;
    box-shadow: 0 0 16px var(--warning-glow);
    animation: pulseNode 2s infinite;
}
.step.state-pending .step-node svg.icon-pending {
    display: block;
}
.step.state-pending .step-node span {
    display: none;
}
.step.state-pending .step-title {
    color: var(--warning);
}
.step.state-pending .step-desc {
    color: var(--text-secondary);
}

/* 3. REJECTED / FAIL STATE */
.step.state-rejected .step-node {
    background: var(--danger-gradient);
    border-color: var(--danger);
    color: white;
    box-shadow: 0 0 16px var(--danger-glow);
}
.step.state-rejected .step-node svg.icon-error {
    display: block;
}
.step.state-rejected .step-node span {
    display: none;
}
.step.state-rejected .step-title {
    color: var(--danger);
}
.step.state-rejected .step-desc {
    color: var(--text-secondary);
}

/* Student Detail Grid */
.detail-grid {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

body.light-theme .detail-grid {
    background: rgba(255, 255, 255, 0.4);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.detail-val {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Final Verdict Alert Panel */
.verdict-panel {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid transparent;
}

.verdict-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.verdict-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.verdict-info h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.verdict-info p {
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Verdict Status Styling */
.verdict-panel.verdict-accepted {
    background: rgba(16, 185, 129, 0.05);
    border-color: var(--success-border);
    color: #34d399;
}
.verdict-panel.verdict-accepted .verdict-info p {
    color: var(--text-secondary);
}

.verdict-panel.verdict-pending {
    background: rgba(245, 158, 11, 0.05);
    border-color: var(--warning-border);
    color: #fbbf24;
}
.verdict-panel.verdict-pending .verdict-info p {
    color: var(--text-secondary);
}

.verdict-panel.verdict-rejected {
    background: rgba(239, 68, 68, 0.05);
    border-color: var(--danger-border);
    color: #f87171;
}
.verdict-panel.verdict-rejected .verdict-info p {
    color: var(--text-secondary);
}

/* Error Message Display */
.error-container {
    display: none;
    align-items: center;
    gap: 14px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid var(--danger-border);
    border-radius: 12px;
    padding: 18px;
    margin-top: 16px;
    color: var(--danger);
    animation: fadeIn 0.4s ease;
}

.error-container svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    flex-shrink: 0;
}

.error-text {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Loading Skeleton & Spinner */
.loading-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 0;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Footer Section */
footer {
    width: 100%;
    padding: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    border-top: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(10px);
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Keyframe Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseNode {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Responsive Breakpoints */
@media (max-width: 640px) {
    .app-card {
        padding: 24px 16px;
    }
    
    .card-title h2 {
        font-size: 1.4rem;
    }
    
    .search-input {
        padding: 16px 110px 16px 44px;
        font-size: 0.9rem;
    }
    
    .search-icon-left {
        left: 14px;
    }
    
    .search-icon-left svg {
        width: 18px;
        height: 18px;
    }
    
    .search-btn {
        padding: 0 12px;
        font-size: 0.8rem;
    }
    
    .clear-btn {
        right: 80px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .stepper::before {
        left: 16px;
    }
    
    .step-node {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    
    .step-node svg {
        width: 14px;
        height: 14px;
    }
}
