/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --light-text: #f1f5f9;
    --secondary-text: #cbd5e1;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(99, 102, 241, 0.4);
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--light-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Header Styles ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: fadeInDown 0.8s ease-out;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.header-content {
    position: relative;
    z-index: 1;
}

.main-title {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 30px;
    opacity: 0.9;
    font-weight: 300;
}

.course-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.info-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.info-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ===== Main Content ===== */
.main-content {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ===== Unit Cards ===== */
.unit-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.unit-card:nth-child(1) {
    animation-delay: 0.1s;
}

.unit-card:nth-child(2) {
    animation-delay: 0.2s;
}

.unit-card:nth-child(3) {
    animation-delay: 0.3s;
}

.unit-card:nth-child(4) {
    animation-delay: 0.4s;
}

.unit-card:nth-child(5) {
    animation-delay: 0.5s;
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), var(--glow);
    border-color: var(--primary-color);
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.unit-title-section {
    flex: 1;
    min-width: 250px;
}

.unit-title {
    font-size: 1.5rem;
    color: var(--light-text);
    margin-bottom: 8px;
    font-weight: 600;
}

.unit-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.unit-meta {
    display: flex;
    gap: 15px;
}

.hours,
.marks {
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 0.9rem;
}

.marks {
    background: rgba(236, 72, 153, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ===== Lists ===== */
.unit-content {
    color: var(--secondary-text);
}

.topic-list {
    list-style: none;
    padding: 0;
}

.topic-list > li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    transition: all 0.3s ease;
}

.topic-list > li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
}

.topic-list > li:hover {
    padding-left: 35px;
    color: var(--light-text);
}

.topic-list strong {
    color: var(--light-text);
    font-weight: 600;
}

.sub-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 8px;
}

.sub-list li {
    padding: 6px 0;
    padding-left: 25px;
    position: relative;
    color: var(--secondary-text);
    transition: all 0.3s ease;
}

.sub-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-size: 1.5rem;
    line-height: 1;
}

.sub-list li:hover {
    padding-left: 30px;
    color: var(--light-text);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    color: var(--secondary-text);
    border-top: 1px solid var(--border-color);
    animation: fadeIn 1s ease-out 0.8s both;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .course-info {
        flex-direction: column;
        align-items: center;
    }
    
    .info-card {
        width: 100%;
        max-width: 300px;
    }
    
    .unit-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .unit-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .unit-title {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 25px 20px;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
    
    .unit-card {
        padding: 20px;
    }
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

/* ===== Selection Styling ===== */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}