:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Animated Shapes */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 20s infinite alternate;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    animation-delay: 0s;
}

.shape-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 60%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    width: 100%;
    max-width: 600px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, #a5b4fc, #fbcfe8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    width: 100%;
}

#searchInput {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border-radius: 100px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 100px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 180px;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn.primary:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

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

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

.status-message {
    color: var(--text-muted);
    font-size: 0.9rem;
    min-height: 1.5rem;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

/* Grid Layout for Directory */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* Glassmorphism Card */
.student-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.student-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.student-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: white;
}

.student-info p {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.detail-row svg {
    flex-shrink: 0;
    margin-top: 0.2rem;
    color: #8b5cf6;
}

.detail-row a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.detail-row a:hover {
    color: var(--primary-color);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px dashed var(--card-border);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .directory-grid {
        grid-template-columns: 1fr;
    }
}
