/**
 * Common Styles for Teaching Pages
 * Southeast Asia University
 * Author: Phaphontee Yamchote
 * 
 * This stylesheet contains shared styles used across all course pages.
 * Include this in your HTML with: <link rel="stylesheet" href="common-styles.css">
 */

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   CSS VARIABLES (THEME COLORS)
   ============================================================ */

:root {
    /* University Brand Colors */
    --darkblue: #002147;
    --gold: #FFD700;
    
    /* Background Colors */
    --light-bg: #f8f9fa;
    --dark-bg: #181818;
    
    /* Text Colors */
    --text-dark: #232323;
    --text-light: #ffffff;
    
    /* Gray Scale */
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-700: #495057;
    
    /* Shadows */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 33, 71, 0.15);
    
    /* Status Colors */
    --success: #2e7d32;
    --info: #1976d2;
    --warning: #f57c00;
    --danger: #c62828;
}

/* ============================================================
   BODY & GENERAL
   ============================================================ */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================
   TOP NAVIGATION BAR
   ============================================================ */

.top-nav {
    background: var(--darkblue);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1001;
    animation: slideDown 0.5s ease-out;
}

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

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: var(--gold);
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    padding-left: 1.5rem;
}

.nav-brand:hover {
    color: var(--text-light);
    transform: translateX(-4px);
}

.nav-brand::before {
    content: '←';
    position: absolute;
    left: 0;
}

.menu-toggle {
    display: none;
    background: var(--gold);
    color: var(--darkblue);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.menu-toggle:hover {
    background: var(--text-light);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero {
    background: linear-gradient(135deg, var(--darkblue) 0%, #003d82 100%);
    color: var(--text-light);
    padding: 2rem;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,215,0,0.1)" stroke-width="0.5"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero h1 {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

.hero-info {
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* ============================================================
   MAIN LAYOUT CONTAINER
   ============================================================ */

.main-layout {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

/* For pages without sidebar (backward compatibility) */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* ============================================================
   LEFT SIDEBAR NAVIGATION (COMPACT DESIGN)
   ============================================================ */

.sidebar {
    background: var(--text-light);
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-title {
    color: var(--darkblue);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid var(--gold);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.3rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.25s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-menu a:hover {
    background: var(--gray-100);
    color: var(--darkblue);
    transform: translateX(3px);
}

.sidebar-menu a.active {
    background: var(--darkblue);
    color: var(--gold);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.sidebar-menu a .icon {
    font-size: 1.1rem;
    min-width: 20px;
}

/* Compact Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--darkblue);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.content-area {
    min-height: 400px;
}

.content-card {
    background: var(--text-light);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   CONTENT SECTIONS WITH FADE-IN ANIMATION
   ============================================================ */

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeInSlide 0.5s ease-out;
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--gold);
}

.section-icon {
    font-size: 2rem;
}

.section-title {
    color: var(--darkblue);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

/* ============================================================
   ALERT BOXES
   ============================================================ */

.alert-box {
    padding: 1.2rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 5px solid;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-danger {
    background: #ffebee;
    border-color: var(--danger);
    color: var(--danger);
}

.alert-info {
    background: #e3f2fd;
    border-color: var(--info);
    color: var(--info);
}

.alert-warning {
    background: #fff3e0;
    border-color: var(--warning);
    color: var(--warning);
}

.alert-box h5 {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ============================================================
   LIST STYLES
   ============================================================ */

.styled-list {
    list-style: none;
    padding-left: 0;
}

.styled-list li {
    padding: 0.8rem 0;
    padding-left: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.styled-list li:last-child {
    border-bottom: none;
}

.styled-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--gold);
}

.styled-list a {
    color: var(--info);
    text-decoration: none;
    transition: color 0.2s ease;
}

.styled-list a:hover {
    color: var(--darkblue);
    text-decoration: underline;
}

/* ============================================================
   TABLE STYLES
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    background: var(--text-light);
}

table.modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table.modern thead th {
    background: var(--darkblue);
    color: var(--gold);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

table.modern tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

table.modern tbody tr:nth-child(even) {
    background: var(--gray-100);
}

table.modern tbody tr:hover {
    background: #e8f4f8;
    transition: background 0.2s ease;
}

.chip {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--gold);
    color: var(--darkblue);
}

/* ============================================================
   SCHEDULE ITEMS
   ============================================================ */

.schedule-item {
    padding: 1.2rem;
    margin-bottom: 1rem;
    background: var(--gray-100);
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    transition: all 0.3s ease;
}

.schedule-item:hover {
    background: var(--text-light);
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.schedule-item strong {
    color: var(--darkblue);
    display: block;
    margin-bottom: 0.5rem;
}

.schedule-item ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    background: var(--darkblue);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.footer p {
    margin: 0;
    color: var(--gold);
    font-weight: 500;
}

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

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .main-container {
        padding: 0 1rem;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar.collapsed {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .main-layout {
        padding: 0 1rem;
    }

    .content-card {
        padding: 1.5rem;
    }

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

    .table-wrap {
        font-size: 0.85rem;
    }

    table.modern thead th,
    table.modern tbody td {
        padding: 0.7rem;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .top-nav,
    .sidebar,
    .footer {
        display: none;
    }

    .main-layout {
        grid-template-columns: 1fr;
    }

    .content-card {
        box-shadow: none;
    }
}
