/* =============== RESET & BASE =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100vh;
}

body {
    background: #0a0a1a;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    overflow: hidden;
    line-height: 1.6;
    height: 100vh;
}

/* =============== ANIMATED BACKGROUND =============== */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(-10px) rotate(240deg); }
}

@keyframes glow {
    0%, 100% { opacity: 0.4; filter: blur(40px); }
    50% { opacity: 0.7; filter: blur(60px); }
}

.background {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: -1;
    background: radial-gradient(ellipse at top, #1a1b38 0%, #0a0a1a 40%, #000000 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    animation: float 15s ease-in-out infinite, glow 8s ease-in-out infinite;
}

.orb:nth-child(1) {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(78, 14, 254, 0.3), transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb:nth-child(2) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(48, 62, 134, 0.25), transparent 70%);
    top: 30%;
    right: -5%;
    animation-delay: -5s;
}

.orb:nth-child(3) {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(33, 41, 99, 0.2), transparent 70%);
    bottom: -20%;
    left: 20%;
    animation-delay: -10s;
}

/* Starfield */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.star:nth-child(1) { top: 20%; left: 30%; animation-delay: 0s; }
.star:nth-child(2) { top: 40%; left: 70%; animation-delay: 1s; }
.star:nth-child(3) { top: 60%; left: 20%; animation-delay: 2s; }
.star:nth-child(4) { top: 80%; left: 80%; animation-delay: 0.5s; }
.star:nth-child(5) { top: 15%; left: 85%; animation-delay: 1.5s; }
.star:nth-child(6) { top: 70%; left: 50%; animation-delay: 2.5s; }

/* =============== NAVIGATION =============== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(10, 10, 26, 0.8);
    border-bottom: 1px solid rgba(98, 44, 248, 0.2);
}

nav {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

.logo {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    background: linear-gradient(135deg, #622cf8, #8b5cf6, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

nav ul {
    display: flex;
    gap: clamp(1rem, 3vw, 2.5rem);
    list-style: none;
}

nav ul a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

nav ul a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #622cf8, #8b5cf6);
    transition: width 0.3s ease;
}

nav ul a:hover {
    color: white;
    background: rgba(98, 44, 248, 0.1);
}

nav ul a:hover::before {
    width: 80%;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* =============== MAIN CONTAINER =============== */
.education-container {
    height: 100vh;
    padding: 100px 5% 100px;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
    overflow: hidden;
}

.page-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 50%, #622cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
    margin-bottom: 2rem;
}

/* =============== TIMELINE CONTAINER =============== */
.timeline-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.timeline-container::-webkit-scrollbar {
    width: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: rgba(98, 44, 248, 0.4);
    border-radius: 10px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: rgba(98, 44, 248, 0.6);
}

/* =============== EDUCATION CARDS =============== */
.education-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.education-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at 50% 50%,
        rgba(98, 44, 248, 0.1),
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.education-card:hover::before {
    opacity: 1;
}

.education-card:hover {
    transform: translateY(-8px);
    border-color: rgba(98, 44, 248, 0.4);
    box-shadow: 0 20px 60px rgba(98, 44, 248, 0.3);
}

.education-card.active {
    border: 2px solid rgba(98, 44, 248, 0.5);
    box-shadow: 0 10px 40px rgba(98, 44, 248, 0.2);
}

/* FIXED LOGO STYLING */
.card-icon {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.card-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    filter: drop-shadow(0 4px 12px rgba(98, 44, 248, 0.3));
    transition: transform 0.3s ease;
}

.education-card:hover .card-icon img {
    transform: scale(1.05);
}

.card-content {
    position: relative;
    z-index: 1;
}

.education-level {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.school-name {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

.year {
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    color: rgba(139, 92, 246, 0.8);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.description {
    font-size: clamp(0.9rem, 1.2vw, 0.9rem);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.achievement-badge {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(98, 44, 248, 0.15);
    border: 1px solid rgba(98, 44, 248, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a78bfa;
}

.achievement-badge.current {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

/* =============== ANIMATIONS =============== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }

/* =============== PAGINATION =============== */
.pagination {
    position: fixed;
    bottom: 30px;
    left: 88%;
    transform: translateX(-50%);
    display: flex;
    gap: 2rem;
    z-index: 100;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.8rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(98, 44, 248, 0.4);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.pagination-btn:hover {
    background: rgba(98, 44, 248, 0.2);
    border-color: #622cf8;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(98, 44, 248, 0.5);
}

.pagination-btn span:first-child,
.pagination-btn span:last-child {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.pagination-btn.prev:hover span:first-child {
    transform: translateX(-3px);
}

.pagination-btn.next:hover span:last-child {
    transform: translateX(3px);
}

.pagination-text {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

/* =============== RESPONSIVE =============== */
@media (max-width: 1200px) {
    .timeline-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
        height: auto;
    }

    .education-container {
        height: auto;
        overflow-y: auto;
        padding-bottom: 120px;
    }

    .timeline-container {
        grid-template-columns: 1fr;
        overflow-y: visible;
    }

    nav ul {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        flex-direction: column;
        background: rgba(10, 10, 26, 0.98);
        backdrop-filter: blur(20px);
        padding: 3rem 2rem;
        gap: 1rem;
        transition: left 0.4s ease;
        border-right: 2px solid rgba(98, 44, 248, 0.3);
    }

    nav ul.active {
        left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    nav ul a {
        width: 100%;
        text-align: center;
        padding: 1.2rem;
        font-size: 1.3rem;
    }

    .pagination {
        bottom: 15px;
        gap: 1rem;
    }

    .pagination-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    .pagination-text {
        display: none;
    }

    .pagination-btn span:first-child,
    .pagination-btn span:last-child {
        font-size: 1.5rem;
    }
}
