:root {
    --primary-color: #194973;
    --secondary-color: #078C36;
    --accent-color: #BF9F63;
    --danger-color: #D92323;
    --text-dark: #0D0D0D;
    --background-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --premium-gradient: linear-gradient(135deg, #194973, #078C36);
    --text-primary: #0D0D0D;
    --text-secondary: #475569;
    --footer-gradient-start: #194973;
    --footer-gradient-end: #0D0D0D;
}

body {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
}

.hero-section {
    background: var(--premium-gradient);
    padding: 7rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='rgba(255,255,255,0.05)' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.6;
}

.hero-section h1,
.hero-section h2,
.hero-section p {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section h1 {
    font-weight: 700;
}

.hero-section h2 {
    color: rgba(255, 255, 255, 0.9);
}

.hero-section p.lead {
    color: rgba(255, 255, 255, 0.85);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.semester-card {
    cursor: pointer;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform-origin: center;
}

.semester-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(25, 73, 115, 0.15);
    border-color: rgba(25, 73, 115, 0.3);
}

.semester-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.semester-card:hover::before {
    animation: shine 1.5s;
}

@keyframes shine {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

.navbar {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    -webkit-text-fill-color: initial;
    background: none;
}

.navbar-logo {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary) !important;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
}

.nav-link:hover {
    color: var(--accent-color) !important;
}

.semester-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.semester-text {
    color: #666;
    font-size: 1.1rem;
}

footer {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.subject-card {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(25, 73, 115, 0.15);
}

.subject-icon-wrapper {
    background: var(--premium-gradient);
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    transition: transform 0.3s ease;
}

.subject-card:hover .subject-icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
}

.subject-icon {
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.subject-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-footer {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(25, 73, 115, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-papers {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.arrow-icon {
    transition: transform 0.3s ease;
}

.subject-card:hover .arrow-icon {
    transform: translateX(8px);
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

.semester-badge {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 3rem;
    font-size: 1.4rem;
    font-weight: 600;
    margin-right: 1.5rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.semester-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.semester-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .semester-header {
        padding: 2rem 0;
    }
    
    .semester-badge {
        margin-bottom: 1rem;
        margin-right: 0;
        padding: 0.5rem 1.5rem;
        font-size: 1.1rem;
    }

    .semester-badge::before {
        font-size: 1.1rem;
    }

    .semester-title {
        font-size: 1.5rem;
    }

    .subject-card {
        padding: 1.5rem;
    }
}

/* Semester Header Styles */
.semester-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    margin-bottom: 2rem;
}

/* Footer Gradient */
.footer-gradient {
    background: linear-gradient(135deg, var(--footer-gradient-start), var(--footer-gradient-end));
    position: relative;
}

.footer-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Add/Update these responsive styles */

/* Base mobile-first styles */
@media (max-width: 768px) {
    /* Navbar mobile improvements */
    .navbar {
        padding: 0.75rem 0;
    }

    .navbar-brand {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .navbar-logo {
        height: 35px;
    }

    .navbar-toggler {
        padding: 0.4rem 0.6rem;
        border: none;
        margin-right: 0;
    }

    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        border-radius: 0 0 1rem 1rem;
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        margin: 0.5rem -1rem -0.75rem -1rem;
    }

    .nav-item {
        margin: 0.25rem 0;
    }

    /* Hero Section mobile improvements */
    .hero-section {
        padding: 3.5rem 1rem;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .hero-section h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .hero-section p.lead {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Semester Cards mobile improvements */
    .semester-card {
        padding: 1.5rem;
        margin: 0.5rem 0;
        border-radius: 16px;
    }

    .semester-number {
        font-size: 2rem;
        margin-bottom: 0.25rem;
    }

    .semester-text {
        font-size: 0.95rem;
    }

    /* Container and spacing improvements */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .row {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    .col, .col-md-6, .col-lg-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Subject Cards mobile improvements */
    .subject-card {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }

    .subject-icon-wrapper {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .subject-description {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    /* Footer mobile improvements */
    footer {
        padding: 2rem 0;
        text-align: center;
    }

    footer h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    footer p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    /* Touch-specific improvements */
    .semester-card:active,
    .subject-card:active {
        transform: scale(0.98);
        transition: transform 0.2s ease;
    }

    .nav-link:active {
        background: rgba(25, 73, 115, 0.1);
        border-radius: 8px;
    }

    /* Safe area insets for notched phones */
    .navbar {
        padding-top: max(0.75rem, env(safe-area-inset-top));
        padding-left: max(1.25rem, env(safe-area-inset-left));
        padding-right: max(1.25rem, env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* Add smooth scrolling and better touch handling */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-tap-highlight-color: transparent;
    }

    body {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
    }

    /* Improve tap targets */
    .nav-link,
    .navbar-toggler,
    .semester-card,
    .subject-card,
    button {
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* Optimize animations for mobile */
@media (max-width: 768px) {
    .semester-card,
    .subject-card {
        animation-duration: 0.4s;
    }

    .page-transition {
        transition-duration: 0.2s;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .semester-card:hover,
    .subject-card:hover {
        transform: none;
    }

    .semester-card:active,
    .subject-card:active {
        transform: scale(0.98);
    }

    .subject-card:hover .arrow-icon {
        transform: none;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .row-cols-md-2 > * {
        flex: 0 0 auto;
        width: 50%;
    }

    .semester-card,
    .subject-card {
        margin: 0.75rem;
    }
}

/* Ensure desktop styles remain unchanged */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
    }

    .row-cols-lg-4 > * {
        flex: 0 0 auto;
        width: 25%;
    }

    .row-cols-lg-3 > * {
        flex: 0 0 auto;
        width: 33.333333%;
    }
}

/* Add smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }

    /* Improve touch targets */
    .nav-link,
    .navbar-toggler,
    .semester-card,
    .subject-card {
        min-height: 44px; /* Apple's recommended minimum touch target size */
    }

    /* Add momentum scrolling for iOS */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix for notched phones */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .container {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }

        .navbar {
            padding-top: max(0.5rem, env(safe-area-inset-top));
        }
    }
}

/* Enhanced animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Apply animations */
.subject-card {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.semester-card {
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Stagger animation for cards */
.row > div:nth-child(1) .subject-card { animation-delay: 0.1s; }
.row > div:nth-child(2) .subject-card { animation-delay: 0.2s; }
.row > div:nth-child(3) .subject-card { animation-delay: 0.3s; }
.row > div:nth-child(4) .subject-card { animation-delay: 0.4s; }

/* Add smooth page transitions */
.page-transition {
    transition: opacity 0.3s ease-in-out;
}

.page-transition.loading {
    opacity: 0;
} 