/* ================================================
   OBGINSOS - Premium SaaS Style CSS
   ================================================ */

:root {
    /* Color Palette - Professional Medical Theme */
    --primary-color: #0f766e;      /* Teal 700 */
    --primary-light: #14b8a6;      /* Teal 500 */
    --primary-dark: #0d5d56;       /* Teal 800 */
    --secondary-color: #1e293b;    /* Slate 800 */
    --accent-color: #f59e0b;       /* Amber 500 */
    --background: #f1f5f9;         /* Slate 100 */
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Spacing */
    --sidebar-width: 320px;
    --header-height: 70px;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ================================================
   HEADER STYLES
   ================================================ */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.header-title span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-light);
}

/* ================================================
   SIDEBAR STYLES
   ================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--secondary-color) 0%, #0f172a 100%);
    color: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Logo Section */
.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    letter-spacing: -0.5px;
}

.sidebar-logo p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation */
.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    padding: 0.75rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-section-title:hover {
    color: rgba(255, 255, 255, 0.7);
}

.nav-section-title .toggle-icon {
    transition: transform 0.3s;
}

.nav-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.nav-section.collapsed .nav-items {
    display: none;
}

.nav-items {
    list-style: none;
}

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

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: var(--primary-light);
}

.nav-link.active {
    background: rgba(20, 184, 166, 0.15);
    color: var(--primary-light);
    border-left-color: var(--primary-light);
    font-weight: 500;
}

.nav-link .icon {
    width: 20px;
    margin-right: 0.75rem;
    opacity: 0.7;
}

.nav-link.active .icon {
    opacity: 1;
}

/* Sub Navigation (Periode) */
.nav-sub {
    list-style: none;
    padding-left: 1rem;
}

.nav-sub .nav-link {
    font-size: 0.8125rem;
    padding: 0.5rem 1.5rem 0.5rem 2.5rem;
}

/* Sub-sub Navigation (Mata Kuliah) */
.nav-sub-sub {
    list-style: none;
    padding-left: 1rem;
}

.nav-sub-sub .nav-link {
    font-size: 0.75rem;
    padding: 0.375rem 1.5rem 0.375rem 3.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.nav-sub-sub .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* ================================================
   MAIN CONTENT AREA
   ================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
}

/* ================================================
   CARDS
   ================================================ */
.card {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--background);
    border-top: 1px solid var(--border-color);
}

/* ================================================
   DASHBOARD STATS
   ================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-color);
}

.stat-icon.secondary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-icon.accent {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-color);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ================================================
   SEMESTER GRID
   ================================================ */
.semester-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.semester-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.semester-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.semester-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.semester-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.semester-body {
    padding: 1.5rem;
}

/* ================================================
   COURSE LIST
   ================================================ */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.course-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.course-item:hover {
    background: rgba(15, 118, 110, 0.05);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.course-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
}

.course-info {
    flex: 1;
}

.course-info h4 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.course-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.course-arrow {
    color: var(--text-secondary);
    transition: transform 0.2s, color 0.2s;
}

.course-item:hover .course-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* ================================================
   DETAIL PAGE (Mata Kuliah)
   ================================================ */
.detail-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0f172a 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    color: #fff;
    margin-bottom: 2rem;
}

.detail-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.detail-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.875rem 1.5rem;
    background: none;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Module Grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.module-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.module-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
}

.module-card h4 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.module-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Quiz & Exam Cards */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.quiz-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.quiz-card:hover {
    border-color: var(--accent-color