/* ===== SETUP & AESTHETICS ===== */
:root {
    --bg-primary: #0A0A0F;
    --bg-secondary: #111118;
    --primary: #00dd99;
    --text-primary: #FFFFFF;
    --text-secondary: #b0b8c4;
    --border: rgba(255, 255, 255, 0.08);
    --font-family: 'Poppins', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-primary); color: var(--text-primary); font-family: var(--font-family); overflow-x: hidden; cursor: none; }
#vanta-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }

/* ===== CURSOR & PRELOADER ===== */
.cursor-dot, .cursor-outline { position: fixed; top: 0; left: 0; pointer-events: none; transform: translate(-50%, -50%); border-radius: 50%; z-index: 9999; }
.cursor-dot { width: 8px; height: 8px; background-color: var(--primary); }
.cursor-outline { width: 40px; height: 40px; border: 2px solid var(--primary); transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
.cursor-grow { transform: translate(-50%, -50%) scale(1.5); opacity: 0.5; }
.preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-primary); z-index: 10000; display: grid; place-items: center; }
.preloader-logo { font-size: 2rem; font-weight: 700; color: var(--primary); }

/* ===== LAYOUT & SIDEBAR ===== */
.app-layout { 
    position: relative; 
}
.sidebar { 
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: 100vh;
    background-color: rgba(10, 10, 15, 0.8); 
    backdrop-filter: blur(10px); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 2rem 0; 
    z-index: 100; 
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 3px;
}
.sidebar-header h1 { 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin-bottom: 3rem; 
    color: var(--primary); 
    cursor: pointer;
    transition: color 0.3s ease;
}
.sidebar-header h1:hover {
    color: var(--text-primary);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.nav-link { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0.25rem; padding: 1rem 0; color: var(--text-secondary); text-decoration: none; border-right: 3px solid transparent; }
.nav-link.active { color: var(--primary); border-right-color: var(--primary); }
.nav-text-small {
    font-size: 0.85em;
    line-height: 1;
}
.user-auth {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
}
.user-profile { display: none; flex-direction: column; align-items: center; gap: 0.75rem; }
#userAvatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); }
#logoutBtn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1.1rem; }
.btn { background-color: var(--primary); color: var(--bg-primary); padding: 0.5rem 1rem; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
#error-container { position: fixed; bottom: 2rem; left: 120px; background-color: #ff3b3b; color: white; padding: 1rem; border-radius: 8px; z-index: 200; display: none; }

/* ===== MAIN CONTENT & PAGE STYLES ===== */
.main-content { 
    padding: 2rem 4rem;
    margin-left: 100px;
}
.page-section { display: none; opacity: 0; }
.page-section.active { display: block; }
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}
.page-header h2 { font-size: 2.5rem; font-weight: 600; }
.reveal-text { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.reveal-text > * { transform: translateY(120%); }
.hero { min-height: 80vh; display: grid; place-content: center; text-align: center; }
.hero h1 { font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 700; line-height: 1.1; margin-bottom: 1.5rem; background: linear-gradient(90deg, var(--text-primary), var(--text-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }
.hero h1 span { background: none; -webkit-background-clip: unset; -webkit-text-fill-color: var(--primary); color: var(--primary); }

/* ===== SEARCH & FILTER CONTROLS ===== */
.course-controls, .club-controls {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}
.course-controls input, .course-controls select, .club-controls input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
}
.course-controls input, .club-controls input {
    flex-grow: 1;
}

/* ===== CARDS & LISTS ===== */
.courses-grid, .content-grid, .tech-stack-grid, #resources-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.interactive-card { position: relative; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(0, 221, 153, 0.05), transparent 25%); }
.course-card, .content-card, .timeline-content, .tech-item { background-color: var(--bg-secondary); border: 1px solid var(--border); backdrop-filter: blur(10px); border-radius: 12px; }

/* Styles for Flipping Club Cards */
#clubs .content-card {
    perspective: 1500px;
    background-color: transparent;
    min-height: 300px;
    border: none;
    cursor: pointer;
    padding: 0;
}
.card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    transform-style: preserve-3d;
}
.content-card:hover .card-flipper {
    transform: rotateY(180deg);
}
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}
.card-front img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
}
.card-front h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}
.card-front p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.card-back {
    transform: rotateY(180deg);
    justify-content: center;
    gap: 1rem;
}
.card-back .cta-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}
.card-back .cta-text i {
    transition: transform 0.3s ease;
}
.content-card:hover .card-back .cta-text i {
    transform: translateX(5px);
}

.section-footer-note {
    text-align: center;
    margin: 3rem auto 0 auto;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 500px;
    line-height: 1.7;
}

/* Styles for Details Page */
.details-content {
    max-width: 1000px;
    margin: 0 auto;
    color: var(--text-secondary);
}
#details-back-btn {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}
.details-main h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.details-main p {
    font-size: 1.1rem;
    line-height: 1.8;
}
.details-meta, .details-events {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.details-main {
    margin-bottom: 2rem;
}
.details-meta h4, .details-events h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.details-meta ul {
    list-style: none;
    padding: 0;
}
.details-meta li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.details-meta li i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}
.details-meta a {
    color: var(--text-secondary);
    text-decoration: none;
    word-break: break-all;
}
.club-event-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.club-event-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.club-event-item h5 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}
.club-event-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.club-event-item .event-date-small {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
}

.course-card { display: flex; flex-direction: column; padding: 0; }
.course-card-header { padding: 1.5rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.course-card-header h3 { font-size: 1.2rem; font-weight: 500; }
.course-card-header .course-code { font-size: 0.9rem; color: var(--primary); }
.course-card-header i { transition: transform 0.3s ease-out; }
.course-card.expanded .course-card-header i { transform: rotate(180deg); }
.course-card-body { padding: 0 1.5rem; color: var(--text-secondary); }
.course-card-body p { margin-bottom: 1rem; }
.course-reqs {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.course-reqs p {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    padding: 0;
}
.course-reqs p:last-child {
    margin-bottom: 0;
}
.course-reqs strong {
    color: var(--primary);
    font-weight: 500;
}
.course-reviews-container { max-height: 0; overflow: hidden; transition: max-height 0.5s ease-out; padding: 0 1.5rem; }
.course-card.expanded .course-reviews-container { max-height: 1000px; padding: 1.5rem; border-top: 1px solid var(--border); }
.review-card { padding: 1rem 0; border-bottom: 1px solid var(--border); text-align: left; }
.review-card:last-child { border-bottom: none; }
.review-author { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.stars { color: var(--primary); }
.review-comment { font-size: 0.9rem; color: var(--text-secondary); }
.review-form { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.star-rating-input { cursor: pointer; font-size: 1.25rem; color: var(--text-secondary); margin-bottom: 1rem; }
.star-rating-input .fas { color: var(--primary); }
.review-form textarea { width: 100%; background: var(--bg-primary); border: 1px solid var(--border); color: var(--text-primary); padding: 0.75rem; border-radius: 8px; min-height: 80px; margin-bottom: 1rem; }
.average-rating { font-weight: 600; color: var(--text-secondary); margin-bottom: 1rem; text-align: left; }
.average-rating .stars { font-size: 1.2rem; }

/* ===== RESOURCE TABS ===== */
.resource-tabs {
    margin-top: 2rem;
}
.tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
.tab-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}
.tab-link:hover {
    color: var(--text-primary);
}
.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.resource-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.resource-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.resource-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}
.resource-card .link-text {
    color: var(--text-primary);
    font-weight: 500;
    align-self: flex-start;
}
.resource-card .link-text i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}
.resource-card:hover .link-text i {
    transform: translateX(4px);
}

/* ===== TIMELINE STYLES ===== */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem 0;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background-color: var(--border);
}
.timeline-item {
    padding: 1rem 3rem;
    position: relative;
    width: 50%;
}
.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 4rem;
}
.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 4rem;
}
.timeline-dot {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid var(--bg-primary);
    top: 30px;
    z-index: 1;
}
.timeline-item:nth-child(odd) .timeline-dot {
    right: -8px;
}
.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}
.timeline-content {
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.timeline-content .event-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    flex-shrink: 0;
}
.timeline-content .event-date span {
    font-size: 1.75rem;
    display: block;
}
.timeline-content .event-details h4 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.event-details p {
    margin-bottom: 1rem;
}
.event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}
.event-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.event-meta i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

/* ===== OPPORTUNITIES STYLES ===== */
.opportunities-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.opportunity-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.3s ease;
}
.opportunity-card:hover {
    box-shadow: 0 0 15px rgba(0, 221, 153, 0.1);
}
.opportunity-details h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
}
.opportunity-details p {
    color: var(--primary);
    font-weight: 500;
    margin: 0.25rem 0 0.5rem 0;
}
.opportunity-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.opportunity-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.opportunity-cta a {
    background-color: var(--primary);
    color: var(--bg-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.opportunity-cta a:hover {
    background-color: #2cffc0;
}

/* ===== ABOUT PAGE & TEAM STYLES ===== */
.about-content { max-width: 800px; font-size: 1.1rem; line-height: 1.7; color: var(--text-secondary); }

.team-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}
.team-grid::-webkit-scrollbar {
    height: 8px;
}
.team-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}
.team-grid::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}
.team-card-simple {
    flex: 0 0 280px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.team-card-simple:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.team-card-simple h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}
.team-card-simple a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}
.team-card-simple a:hover {
    color: var(--primary);
}

.tech-stack-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.tech-item { padding: 1.5rem; text-align: center; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.tech-item i { font-size: 2.5rem; color: var(--text-primary); display: block; margin-bottom: 0.75rem; }

/* ===== RESPONSIVE DESIGN ===== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

@media screen and (max-width: 900px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    .timeline::before {
        left: 30px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 20px;
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
    }
    .timeline-dot,
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 22px;
    }
}

@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor-dot, .cursor-outline { display: none; }
    
    .sidebar {
        position: fixed;
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .sidebar.mobile-visible {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 4rem 1rem 2rem 1rem;
    }

    .menu-toggle {
        display: block;
    }
}