/* Custom CSS */
:root {
    /* Light Mode Variables */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --error-color: #ef4444;
    --success-color: #10b981;
    
    --glass-border: rgba(255, 255, 255, 0.5);
    
    --transition-speed: 0.3s;
}

.dark-mode {
    /* Dark Mode Variables */
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.1);
    
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    
    --glass-border: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
}

#app {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.app-background {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--primary-light) 0%, transparent 50%);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    transition: background var(--transition-speed) ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    animation: slideDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-upload {
    background: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-upload:hover {
    background: var(--primary-color);
    color: white;
}

.dark-mode .btn-upload {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

.dark-mode .btn-upload:hover {
    background: var(--primary-hover);
    color: white;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Main Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-speed) ease;
    animation: fadeIn 0.8s ease-out;
}

.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.card-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.card-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.data-status {
    margin-top: 1rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Search Form */
.search-form {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.input-group.focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-group.has-error {
    border-color: var(--error-color);
}

.input-icon {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 0;
    font-size: 1.1rem;
    color: var(--text-main);
    outline: none;
    width: 100%;
}

.input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-msg {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding-left: 1rem;
    animation: fadeIn 0.3s ease;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Results Section */
.result-section {
    background: var(--bg-color);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.student-info h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.student-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border: none;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

.stat-card.highlight .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-card.highlight .stat-value {
    color: white;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.total-icon { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.avg-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.rank-icon { background: rgba(255, 255, 255, 0.2); color: white; }

.dark-mode .total-icon { background: rgba(59, 130, 246, 0.2); }
.dark-mode .avg-icon { background: rgba(16, 185, 129, 0.2); }

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Not Found Section */
.not-found-section {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--bg-color);
    border-radius: 20px;
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.not-found-section h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.not-found-section p {
    color: var(--text-muted);
}

/* Footer */
footer {
    margin-top: auto;
    text-align: center;
    padding-top: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Vue Transitions */
.fade-slide-enter-active,
.fade-slide-leave-active {
    transition: all 0.4s ease;
}

.fade-slide-enter-from {
    opacity: 0;
    transform: translateY(20px);
}

.fade-slide-leave-to {
    opacity: 0;
    transform: translateY(-20px);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
        border: none;
        background: transparent;
        padding: 0;
    }
    
    .input-group.focused {
        box-shadow: none;
    }
    
    .input-group input {
        background: var(--bg-color);
        border: 2px solid var(--border-color);
        border-radius: 12px;
        padding: 1rem 1rem 1rem 3rem;
        margin-bottom: 1rem;
    }
    
    .input-icon {
        position: absolute;
        left: 0;
        top: 1rem;
        z-index: 10;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .btn-upload {
        padding: 0.5rem;
    }
    
    .upload-text {
        display: none;
    }
}
