:root {
    /* Primary Colors */
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --accent-bg: #2a2a2a;
    --card-bg: rgba(26, 26, 26, 0.95);
    --glass-bg: rgba(42, 42, 42, 0.8);

    /* Accent Colors */
    --primary-accent: #00d4ff;
    --secondary-accent: #ff6b6b;
    --success-accent: #00ff88;
    --warning-accent: #ffb347;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --text-muted: #666666;
    --text-accent: #00d4ff;

    /* Border Colors */
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 212, 255, 0.3);
    --border-hover: rgba(0, 212, 255, 0.5);

    /* Shadow Colors */
    --shadow-primary: rgba(0, 0, 0, 0.5);
    --shadow-accent: rgba(0, 212, 255, 0.2);
    --shadow-hover: rgba(0, 212, 255, 0.4);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff, #ff6b6b);
    --gradient-secondary: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    --gradient-bg: linear-gradient(135deg,
            #0a0a0a 0%,
            #1a1a1a 50%,
            #2a2a2a 100%);
    --gradient-card: linear-gradient(145deg,
            rgba(42, 42, 42, 0.9),
            rgba(26, 26, 26, 0.9));
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 25% 25%,
            rgba(0, 212, 255, 0.1) 0%,
            transparent 50%),
        radial-gradient(circle at 75% 75%,
            rgba(255, 107, 107, 0.08) 0%,
            transparent 50%),
        radial-gradient(circle at 50% 50%,
            rgba(0, 255, 136, 0.05) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(1deg);
    }
}

header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 1rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 32px var(--shadow-primary);
}

.header-title {
    font-size: 30px;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
    }

    to {
        filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.8));
    }
}

.header-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.search-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 3rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 25px 50px var(--shadow-primary),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px var(--border-primary);
    border: 1px solid var(--border-primary);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.search-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transition: left 0.6s ease;
}

.search-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 35px 70px var(--shadow-primary),
        0 0 0 1px var(--border-hover), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.search-card:hover::before {
    left: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.form-group {
    position: relative;
}

label {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input,
select {
    width: 100%;
    padding: 1.25rem 1.5rem;
    border-radius: 18px;
    border: 2px solid var(--border-primary);
    font-size: 1rem;
    background: var(--secondary-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 4px var(--shadow-accent);
    transform: translateY(-2px);
    background: var(--accent-bg);
}

input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

select option {
    background: var(--secondary-bg);
    color: var(--text-primary);
    padding: 0.5rem;
}

.search-button {
    background: var(--gradient-primary);
    color: var(--text-primary);
    border: none;
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 10px 30px var(--shadow-accent);
}

.search-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: left 0.6s ease;
}

.search-button::after {
    content: "🚀";
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.search-button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px var(--shadow-hover);
}

.search-button:hover::before {
    left: 100%;
}

.search-button:hover::after {
    transform: translateY(-50%) rotate(15deg) scale(1.2);
}

.search-button:active {
    transform: translateY(-2px) scale(1.01);
}

.loading {
    text-align: center;
    padding: 4rem;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-primary);
    border-radius: 50%;
    border-top-color: var(--primary-accent);
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

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

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.student-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid var(--border-primary);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px var(--shadow-primary),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.student-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.student-card::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle,
            rgba(0, 212, 255, 0.1) 0%,
            transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease;
}

.student-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 30px 60px var(--shadow-primary),
        0 0 0 1px var(--border-hover), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.student-card:hover::before {
    opacity: 1;
}

.student-card:hover::after {
    transform: scale(1);
}

.student-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.student-name::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-accent);
    border-radius: 2px;
}

.student-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--border-accent);
}

.detail-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

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

.rank-highlight {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.rank-highlight::before {
    content: "🏆";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.5rem;
    opacity: 0.3;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    font-weight: 600;
    margin-top: 2rem;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: white;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Footer */
.footer {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-text {
    color: #94a3b8;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.footer-text a {
    color: #667eea;
    text-decoration: none;
}

.footer-text a:hover {
    text-decoration: underline;
}


@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .search-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .student-card {
        padding: 1.5rem;
    }

    .student-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 2rem;
    }

    .search-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .student-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}


/* Social Icons in Footer */

/* Improved Social Icons in Footer */
.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;
    margin-top: 0.7rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 4px 24px 0 rgba(102, 126, 234, 0.10), 0 1.5px 8px 0 rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(255, 255, 255, 0.18);
    transition: background 0.25s, transform 0.18s, box-shadow 0.18s, border 0.18s;
    font-size: 1.7em;
    color: #e2e8f0;
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

.social-icons a:before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 0 16px 6px #667eea;
    z-index: 0;
}

.social-icons a:hover:before {
    opacity: 0.25;
}

.social-icons a:hover {
    background: linear-gradient(135deg, #667eea 60%, #f093fb 100%);
    color: #fff !important;
    transform: translateY(-4px) scale(1.13) rotate(-7deg);
    box-shadow: 0 8px 32px 0 rgba(102, 126, 234, 0.22), 0 2px 12px 0 rgba(0, 0, 0, 0.13);
    border: 2.5px solid #fff;
    text-decoration: none;
}

.social-icons a[title="LinkedIn"] {
    color: #0e76a8;
}

.social-icons a[title="GitHub"] {
    color: #333;
}

.social-icons a[title="Instagram"] {
    color: #e4405f;
}

.social-icons a:hover[title="LinkedIn"] {
    background: linear-gradient(135deg, #0e76a8 60%, #667eea 100%);
    box-shadow: 0 0 18px 2px #0e76a8;
}

.social-icons a:hover[title="GitHub"] {
    background: linear-gradient(135deg, #333 60%, #667eea 100%);
    box-shadow: 0 0 18px 2px #333;
}

.social-icons a:hover[title="Instagram"] {
    background: linear-gradient(135deg, #e4405f 60%, #f093fb 100%);
    box-shadow: 0 0 18px 2px #e4405f;
}

.social-icons i {
    font-size: 1.25em;
    z-index: 1;
    transition: transform 0.18s;
}

.social-icons a:hover i {
    transform: scale(1.22) rotate(10deg);
}