/* CRITICAL: Background & Layout Mobile Visibility Fixes */
html {
    height: 100% !important;
    background-color: transparent !important;
    background: transparent !important;
    margin: 0;
    padding: 0;
}
body {
    min-height: 100% !important;
    height: auto !important;
    background-color: transparent !important;
    background: transparent !important;
    margin: 0;
    padding: 0;
}

#hero-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    display: block;
}

.site-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3;
    background-color: #0a0a0a !important;
}

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Centered Mobile Loader Fix */
@media (max-width: 768px) {
    .loader-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #0a0a0a !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 99999 !important;
    }
    .loader-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
    }
}

/* Mobile Navbar Force Display */
@media (max-width: 768px) {
    .navbar {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 10000 !important;
        opacity: 1 !important;
        visibility: visible !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .menu-icon {
        display: block !important;
        position: absolute !important;
        right: 20px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        color: white !important;
        font-size: 1.8rem !important;
        z-index: 10001 !important;
        cursor: pointer !important;
    }
    .nav-links {
        display: none !important;
    }
    .logo {
        max-width: 80% !important;
    }
}

/* --- Semester Cards Modern Styling --- */
.semester-card {
    position: relative;
    background: rgba(15, 15, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
}

/* Gradient animated border effect */
.semester-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(45deg, transparent, rgba(209, 26, 42, 0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: all 0.5s ease;
    opacity: 0.5;
    z-index: -1;
}

.semester-card:hover::before {
    background: linear-gradient(45deg, var(--neon-red, #d11a2a), #ff4d4d, var(--neon-red, #d11a2a));
    background-size: 200% 200%;
    animation: gradientBorder 3s ease infinite;
    opacity: 1;
}

@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Inner glow and hover scale */
.semester-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(209, 26, 42, 0.2);
    background: rgba(20, 20, 25, 0.8);
}

.semester-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(209, 26, 42, 0.1) 0%, rgba(209, 26, 42, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(209, 26, 42, 0.2);
    transition: all 0.5s ease;
    position: relative;
}

.semester-card:hover .semester-icon-wrapper {
    background: linear-gradient(135deg, rgba(209, 26, 42, 0.2) 0%, rgba(209, 26, 42, 0.1) 100%);
    box-shadow: 0 0 20px rgba(209, 26, 42, 0.4);
    transform: rotateY(180deg);
}

.semester-icon {
    font-size: 2.5rem;
    margin-bottom: 0;
    color: var(--neon-red, #d11a2a);
    text-shadow: 0 0 15px rgba(209, 26, 42, 0.4);
    transition: all 0.5s ease;
}

.semester-card:hover .semester-icon {
    transform: rotateY(-180deg); /* Counter rotate icon so it stays readable */
    text-shadow: 0 0 25px rgba(209, 26, 42, 0.8);
}

.semester-card h3 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.semester-card p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.semester-card:hover p {
    color: rgba(255, 255, 255, 0.85);
}

/* Re-styled Button */
.semester-btn {
    padding: 0.75rem 2rem;
    background: transparent;
    color: var(--neon-red, #d11a2a);
    border: 1px solid var(--neon-red, #d11a2a);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.4s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.semester-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--neon-red, #d11a2a);
    transition: all 0.4s ease;
    z-index: -1;
}

.semester-card:hover .semester-btn::before {
    width: 100%;
}

.semester-card:hover .semester-btn {
    color: #ffffff;
    box-shadow: 0 0 15px rgba(209, 26, 42, 0.5);
}

/* Semi-transparent Glossy Back Button */
.glossy-back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.glossy-back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(209, 26, 42, 0.3);
}

.glossy-back-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
