/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1%, transparent 2%);
    background-size: 50px 50px;
    animation: sparkle 20s linear infinite;
}

@keyframes sparkle {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 1s ease;
}

.header h2 {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 10px;
    animation: fadeInDown 1.2s ease;
}

.header h3 {
    font-size: 1.5em;
    font-weight: 500;
    opacity: 0.9;
    animation: fadeInDown 1.4s ease;
}

.header-info {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: fadeIn 1.6s ease;
}

/* Section Styles */
section {
    padding: 40px 30px;
    animation: fadeIn 1s ease;
}

.section-title {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 2px;
}

/* Typology Section */
.typology-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.typology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.typology-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--secondary-color);
}

.typology-card:nth-child(2) {
    border-top-color: var(--success-color);
}

.typology-card:nth-child(3) {
    border-top-color: var(--accent-color);
}

.typology-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.typology-card h3 {
    color: var(--text-dark);
    font-size: 1.2em;
    margin-bottom: 15px;
}

.typology-card .marks {
    font-size: 2em;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 10px 0;
}

.typology-card .percentage {
    font-size: 1.3em;
    color: var(--text-light);
    font-weight: 600;
}

/* Units Overview */
.units-overview {
    background: var(--light-bg);
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.unit-card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 5px solid var(--secondary-color);
}

.unit-card[data-unit="1"] {
    border-left-color: #3498db;
}

.unit-card[data-unit="2"] {
    border-left-color: #27ae60;
}

.unit-card[data-unit="3"] {
    border-left-color: #f39c12;
}

.unit-card[data-unit="4"] {
    border-left-color: #e74c3c;
}

.unit-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.unit-header h3 {
    color: var(--primary-color);
    font-size: 1.5em;
}

.unit-marks {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.unit-card h4 {
    color: var(--text-dark);
    font-size: 1.1em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.contact-hours {
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: 10px;
}

/* Detailed Syllabus */
.detailed-syllabus {
    background: var(--white);
}

.unit-details {
    margin-bottom: 40px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.unit-details:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow);
}

.unit-details-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.unit-details-header h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.unit-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.info-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.topics-list {
    padding: 30px;
}

.topic {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.topic:hover {
    background: #e8f4f8;
    transform: translateX(5px);
}

.topic h4 {
    color: var(--primary-color);
    font-size: 1.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic ul {
    list-style: none;
    padding-left: 0;
}

.topic ul li {
    padding: 8px 0 8px 30px;
    position: relative;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.topic ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2em;
}

.topic ul li:hover {
    color: var(--secondary-color);
    padding-left: 35px;
}

.note {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    border-radius: 5px;
    color: #856404;
}

/* Weightage Section */
.weightage-section {
    background: var(--light-bg);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.weightage-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.weightage-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.weightage-table th,
.weightage-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.weightage-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

.weightage-table tbody tr {
    transition: background 0.3s ease;
}

.weightage-table tbody tr:hover {
    background: #f8f9fa;
}

.weightage-table td div {
    padding: 3px 0;
}

.weightage-table tfoot {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

/* Note Section */
.note-section {
    background: var(--white);
}

.note-box {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
}

.note-box h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.5em;
}

.note-box p {
    color: var(--text-dark);
    font-size: 1.1em;
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 25px;
    position: relative;
}

.footer p {
    margin: 0;
    font-size: 1em;
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 2em;
    }

    .header h2 {
        font-size: 1.5em;
    }

    .header h3 {
        font-size: 1.2em;
    }

    section {
        padding: 25px 20px;
    }

    .section-title {
        font-size: 1.5em;
    }

    .typology-grid,
    .units-grid {
        grid-template-columns: 1fr;
    }

    .unit-details-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .unit-info {
        margin-top: 10px;
    }

    .weightage-table {
        font-size: 0.9em;
    }

    .weightage-table th,
    .weightage-table td {
        padding: 10px 8px;
    }

    .scroll-top-btn {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .header h2 {
        font-size: 1.2em;
    }

    .header h3 {
        font-size: 1em;
    }

    .badge {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .section-title {
        font-size: 1.3em;
    }

    .typology-card .marks {
        font-size: 1.5em;
    }

    .unit-details-header h3 {
        font-size: 1.2em;
    }

    .topic h4 {
        font-size: 1em;
    }

    .weightage-table {
        font-size: 0.8em;
    }
}

/* Print Styles */
@media print {
    body {
        background: var(--white);
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .scroll-top-btn {
        display: none;
    }

    .unit-card,
    .typology-card,
    .topic {
        break-inside: avoid;
    }
}