
:root {
    --primary: #3b82f6;
    --secondary: #8b5cf6;
    --text-dark: #1e293b;
    --text-light: #e5e7eb;
    --bg-light: #f8fafc;
    --bg-dark: #0b1220;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-dark);
    transition: background 0.4s, color 0.4s;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: white;
    color: var(--text-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: slideDown 1s ease;
    border-bottom: 1px solid #e2e8f0;
}
header .logo{
    font-size: 24px;
}

@keyframes slideDown {
    from {transform: translateY(-100%);}
    to {transform: translateY(0);}
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 1.5s ease;
    font-family: 'Poppins', sans-serif;
    color: #3b82f6;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 767px) {
    .logo-img {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        width: 28px;
        height: 28px;
    }
}

/* Navigation removed; styles left intentionally blank */

.back-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid #bfdbfe;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 15px;
    transition: background 0.3s,transform 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items:self-end;
}

.back-btn:hover { background: rgba(59, 130, 246, 0.2); transform: translateY(-2px); }

.theme-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.theme-btn:hover {
    transform: rotate(20deg);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Hero Section */
.syllabus-hero {
    background: white;
    color: var(--text-dark);
    text-align: center;
    padding: 80px 20px;
    animation: fadeInUp 1.5s ease;
    border-bottom: 2px solid #e2e8f0;
}

@keyframes fadeInUp {
    from {opacity: 0; transform: translateY(50px);}
    to {opacity: 1; transform: translateY(0);}
}

.syllabus-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--primary);
}

.syllabus-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Department Cards */
.syllabus-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeIn 1.5s ease;
}

.section-title h2 {
    font-size: 2.4rem;
    color: var(--text-dark);
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.dept-syllabus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.syllabus-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
    display: block; /* anchor styling */
    text-decoration: none;
    color: var(--text-dark);
    background: white;
    border: 2px solid #e2e8f0;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInCard 1s forwards;
}

@keyframes fadeInCard {
    to {opacity: 1; transform: translateY(0);}
}

.syllabus-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(102,126,234,0.3);
}

.card-header {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    background: linear-gradient(135deg, #f0f9ff, #f8fafc);
    border-bottom: none;
}
/* smooth transition for header pop */
.card-header { transition: transform 0.22s cubic-bezier(.2,.9,.3,1), box-shadow 0.22s ease; }

.card-header .icon-wrap {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 28px;
    color: white;
    animation: pulse 3s ease-in-out infinite;
}
/* Pause animation and pop icon on card hover - SUBTLE scale only, no rotation */
.card-header:hover .icon-wrap {
    animation-play-state: paused;
    transform: scale(1.08) !important;
    rotate: 0deg !important;
    transition: transform 0.2s ease-out;
}

@keyframes pulse {
    0%, 100% {transform: scale(1);}
    50% {transform: scale(1.1);}
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Pop the header above other cards on hover */
.syllabus-card:hover .card-header {
    transform: translateY(-12px) scale(1.025);
    z-index: 120;
    box-shadow: 0 30px 60px rgba(16,24,40,0.28);
}

.dept-code {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Removed colored top borders to keep card frames uniform */

/* Stats Section */
.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 60px;
    background: linear-gradient(135deg, #f0f9ff, #f8fafc);
    border-radius: 15px;
    padding: 40px 20px;
    border: 2px solid #e2e8f0;
    animation: fadeInUp 1.5s ease;
}

.stat-item {
    text-align: center;
    margin: 15px;
    transition: transform 0.3s;
}

.stat-item:hover {
    transform: scale(1.1);
}

.stat-item h4 {
    font-size: 2.2rem;
    color: var(--primary);
    font-weight: 900;
}

/* subtle pop animation on change */
.stat-item .pop { transform: scale(1.06); transition: transform 0.5s ease; }

.stat-item p {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Footer */
footer {
    background: white;
    color: var(--text-dark);
    padding: 50px 20px 20px;
    margin-top: 80px;
    animation: fadeIn 1.5s ease;
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-dark);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-section ul li a:hover {
    opacity: 1;
    color: var(--primary);
}

.social-links a {
    color: var(--text-light);
    margin-right: 12px;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: scale(1.2) rotate(10deg);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    font-size: 0.9rem;
    opacity: 0.9;
    color: var(--text-dark);
}

/* Animations */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Dark Mode */
.dark-mode {
    background: var(--bg-dark);
    color: var(--text-light);
}
.dark-mode .section-title h2 {
    color: var(--text-light);
}

.dark-mode .syllabus-card {
    background: #0f172a;
    border-color: #1f2937;
    color: var(--text-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.dark-mode .syllabus-hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-light);
    border-bottom-color: var(--primary);
}

.dark-mode .syllabus-hero h1 {
    color: var(--text-light);
}

.dark-mode .stat-item p {
    color: var(--text-light);
}

.dark-mode .stats {
    background: #0f172a;
    border-color: #1f2937;
}

html.dark {
    --bg-dark: #0b1220;
}

/* Responsive */
/* ==================== RESPONSIVE DESIGN ==================== */

/* Very small mobile (≤480px) */
@media (max-width: 480px) {
    header { padding: 10px 12px; gap: 8px; }
    .logo { font-size: 16px; gap: 6px; }
    .logo i { font-size: 16px; }
    .back-btn { font-size: 10px; padding: 6px 10px; }
    .theme-btn { font-size: 16px; }
    .syllabus-hero { padding: 40px 12px; }
    .syllabus-hero h1 { font-size: 24px; margin-bottom: 10px; }
    .syllabus-hero p { font-size: 13px; }
    .syllabus-container { margin: 30px auto; padding: 0 12px; }
    .section-title { margin-bottom: 30px; }
    .section-title h2 { font-size: 20px; }
    .section-title h2::after { width: 50px; height: 3px; }
    .dept-syllabus-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
    .syllabus-card { border-radius: 12px; }
    .card-header { padding: 24px 12px; }
    .card-header .icon-wrap { width: 50px; height: 50px; font-size: 22px; margin-bottom: 10px; }
    .card-header h3 { font-size: 16px; }
    .dept-code { font-size: 10px; padding: 4px 8px; top: 8px; right: 8px; }
    .stats { margin-top: 30px; padding: 16px 4px; border-radius: 12px; flex-direction: row; justify-content: space-between; gap: 2px; flex-wrap: nowrap; overflow-x: auto; }
    .stat-item { margin: 0; flex: 1 1 90px; }
    .stat-item h4 { font-size: 20px; }
    .stat-item p { font-size: 10px; }
    footer { padding: 30px 12px 15px; margin-top: 40px; }
    .footer-content { gap: 20px; }
    .footer-section h4 { font-size: 16px; margin-bottom: 10px; }
    .footer-section ul li { margin-bottom: 6px; font-size: 13px; }
    .footer-bottom { margin-top: 24px; font-size: 12px; }
}

/* Mobile general (481px-640px) */
@media (min-width: 481px) and (max-width: 640px) {
    header { padding: 12px 14px; gap: 10px; }
    .logo { font-size: 18px; gap: 8px; }
    .logo i { font-size: 18px; }
    .back-btn { font-size: 11px; padding: 7px 12px; }
    .theme-btn { font-size: 18px; }
    .syllabus-hero { padding: 50px 16px; }
    .syllabus-hero h1 { font-size: 32px; margin-bottom: 12px; }
    .syllabus-hero p { font-size: 15px; }
    .syllabus-container { margin: 40px auto; padding: 0 16px; }
    .section-title { margin-bottom: 35px; }
    .section-title h2 { font-size: 28px; }
    .section-title h2::after { width: 60px; }
    .dept-syllabus-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
    .card-header { padding: 30px 16px; }
    .card-header .icon-wrap { width: 60px; height: 60px; font-size: 24px; }
    .card-header h3 { font-size: 18px; }
    .dept-code { font-size: 11px; padding: 5px 10px; }
    .stats { margin-top: 34px; padding: 18px 6px; flex-direction: row; justify-content: space-between; gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
    .stat-item { margin: 0; flex: 1 1 100px; }
    .stat-item h4 { font-size: 22px; }
    .stat-item p { font-size: 11px; }
    footer { padding: 40px 16px 18px; margin-top: 50px; }
    .footer-content { gap: 24px; }
    .footer-section h4 { font-size: 17px; }
    .footer-section ul li { font-size: 14px; }
    .footer-bottom { margin-top: 28px; font-size: 13px; }
}

/* Tablet (641px-1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    header { padding: 14px 24px; }
    .logo { font-size: 20px; }
    .back-btn { font-size: 12px; padding: 7px 13px; }
    .theme-btn { font-size: 20px; }
    .syllabus-hero { padding: 60px 24px; }
    .syllabus-hero h1 { font-size: 40px; }
    .syllabus-hero p { font-size: 17px; }
    .syllabus-container { margin: 50px auto; padding: 0 24px; }
    .section-title { margin-bottom: 40px; }
    .section-title h2 { font-size: 32px; }
    .dept-syllabus-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
    .card-header { padding: 35px 20px; }
    .card-header .icon-wrap { width: 65px; height: 65px; font-size: 26px; }
    .card-header h3 { font-size: 20px; }
    .stats { margin-top: 50px; padding: 35px 20px; }
    .stat-item h4 { font-size: 28px; }
    footer { padding: 45px 24px 18px; margin-top: 60px; }
    .footer-section h4 { font-size: 18px; }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .syllabus-hero { padding: 30px 16px; }
    .syllabus-hero h1 { font-size: 28px; }
    header { padding: 10px 16px; }
    .logo { font-size: 16px; }
}

/* Large desktop */
@media (min-width: 1400px) {
    .syllabus-container { max-width: 1400px; }
    .dept-syllabus-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ DARK MODE STYLES FOR SYLLABUS ============ */
html.dark {
    --primary: #60a5fa;
    --secondary: #a78bfa;
    --text-dark: #f1f5f9;
    --text-light: #cbd5e1;
    --bg-light: #0a0e27;
    --bg-dark: #111729;
}

html.dark body {
    background: linear-gradient(135deg, #0a0e27 0%, #111729 50%, #0f1a2e 100%) !important;
    color: #f1f5f9 !important;
}

html.dark header {
    background: linear-gradient(180deg, #1a1f3a 0%, #111729 100%) !important;
    border-bottom-color: rgba(148, 163, 184, 0.15) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

html.dark .logo {
    color: #7dd3fc !important;
    text-shadow: 0 0 12px rgba(125, 211, 252, 0.45);
}

html.dark .logo-brand {
    color: #7dd3fc !important;
    text-shadow: 0 0 12px rgba(125, 211, 252, 0.45);
}

html.dark .back-btn {
    background: rgba(96, 165, 250, 0.2) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
}

html.dark .back-btn:hover {
    background: rgba(96, 165, 250, 0.3) !important;
}

html.dark .theme-btn {
    color: #60a5fa !important;
}

html.dark .theme-btn:hover {
    color: #93c5fd !important;
}

html.dark .syllabus-hero {
    background: linear-gradient(135deg, #111729 0%, #1a1f3a 100%) !important;
    border-bottom-color: rgba(96, 165, 250, 0.2) !important;
    color: #f1f5f9 !important;
}

html.dark .syllabus-hero h1 {
    color: #60a5fa !important;
}

html.dark .syllabus-hero p {
    color: #cbd5e1 !important;
}

html.dark .section-title h2 {
    color: #f1f5f9 !important;
}

html.dark .syllabus-card {
    background: linear-gradient(135deg, #111729 0%, #1a1f3a 100%) !important;
    border-color: rgba(96, 165, 250, 0.15) !important;
    color: #cbd5e1 !important;
}

html.dark .syllabus-card:hover {
    box-shadow: 0 20px 40px rgba(96, 165, 250, 0.15) !important;
}

html.dark .card-header {
    background: linear-gradient(135deg, #1e40af15 0%, #3b82f615 100%) !important;
    border-bottom-color: #60a5fa !important;
}

html.dark .card-header h3 {
    color: #f1f5f9 !important;
}

html.dark .card-header .icon-wrap {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%) !important;
    color: #ffffff !important;
}

/* FIX: Reduce icon hover animation - remove heavy rotation and scaling */
html.dark .card-header:hover .icon-wrap {
    transform: scale(1.08) !important;
    transition: transform 0.2s ease-out !important;
    animation-play-state: paused !important;
}

html.dark .dept-code {
    background: rgba(96, 165, 250, 0.25) !important;
    color: #93c5fd !important;
}

html.dark .stats {
    background: linear-gradient(135deg, #1e40af15 0%, #3b82f615 100%) !important;
    border-color: rgba(96, 165, 250, 0.2) !important;
}

html.dark .stat-item h4 {
    color: #60a5fa !important;
}

html.dark .stat-item p {
    color: #cbd5e1 !important;
}

html.dark footer {
    background: linear-gradient(180deg, #111729 0%, #0a0e27 100%) !important;
    border-top-color: rgba(96, 165, 250, 0.15) !important;
    color: #cbd5e1 !important;
}

html.dark footer a {
    color: #60a5fa !important;
}

html.dark footer a:hover {
    color: #93c5fd !important;
}

/* Global text fixes in dark mode */
html.dark {
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.dark p, html.dark span, html.dark a, html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 {
    color: var(--text-dark) !important;
    text-shadow: none !important;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablet (768px-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    header { padding: 16px 40px; }
    .hero { padding: 50px 40px; }
    .container { padding: 0 40px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
    header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .back-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .hero {
        padding: 30px 16px;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .tab {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    main {
        padding: 30px 16px;
    }
    
    .cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card h3 {
        font-size: 16px;
    }
    
    .card p {
        font-size: 13px;
    }
    
    .download-btn {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    footer {
        padding: 20px 16px;
        font-size: 13px;
    }
}

/* Very small mobile (320px-480px) */
@media (max-width: 480px) {
    header {
        padding: 10px 12px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .back-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .hero {
        padding: 24px 12px;
    }
    
    .hero h1 {
        font-size: 20px;
    }
    
    .hero p {
        font-size: 13px;
    }
    
    .tabs {
        gap: 6px;
    }
    
    .tab {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    main {
        padding: 24px 12px;
    }
    
    .card {
        padding: 12px;
    }
    
    .card h3 {
        font-size: 14px;
    }
    
    .card p {
        font-size: 12px;
    }
    
    .icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .download-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 20px 16px;
    }
    
    .hero h1 {
        font-size: 22px;
    }
    
    main {
        padding: 30px 16px;
    }
}

/* Large desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .cards {
        grid-template-columns: repeat(4, 1fr);
    }
}


