/* Linear Algebra Course - HYPER COMPACT with LEFT SIDEBAR */
:root {
    --ml-purple: #3333B2;
    --ml-lavender: #ADADD0;
    --ml-lavender2: #C1C1E8;
    --ml-lavender3: #CCCCEB;
    --ml-lavender4: #D6D6EF;
    --ml-blue: #0066CC;
    --ml-orange: #FF7F0E;
    --ml-green: #2CA02C;
    --ml-red: #D6272D;
    --ml-gray: #7F7F7F;
    --ml-light: #F8F9FA;
    --ml-dark: #1A1A2E;
    --sidebar-width: 100px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.25;
    color: var(--ml-dark);
    background-color: var(--ml-light);
    font-size: 11px;
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar Navigation */
nav {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--ml-purple), var(--ml-lavender));
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    padding: 0.3rem 0.2rem;
    display: flex;
    flex-direction: column;
}

nav .nav-title {
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    padding: 0.2rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.2rem 0.3rem;
    border-radius: 2px;
    font-size: 0.65rem;
    display: block;
    transition: background 0.15s;
}

nav a:hover, nav a.active {
    background-color: rgba(255,255,255,0.25);
}

/* Main wrapper */
.page-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header - Hyper Compact */
header {
    background-color: var(--ml-lavender3);
    color: var(--ml-purple);
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid var(--ml-lavender);
}

header h1 { font-size: 1rem; margin-bottom: 0; }
header p { font-size: 0.65rem; color: var(--ml-gray); }

/* Main Content */
main {
    flex: 1;
    max-width: 1000px;
    padding: 0.3rem;
}

section { margin-bottom: 0.4rem; }

h2 {
    color: var(--ml-purple);
    border-bottom: 1px solid var(--ml-lavender);
    padding-bottom: 0.15rem;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

h3 {
    color: var(--ml-blue);
    margin: 0.15rem 0;
    font-size: 0.75rem;
}

/* Cards - Hyper Compact */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.2rem;
}

.card {
    background: white;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    padding: 0.25rem;
    transition: box-shadow 0.15s;
}

.card:hover { box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.card h3 { color: var(--ml-purple); margin: 0 0 0.15rem 0; font-size: 0.7rem; }
.card p { color: var(--ml-gray); margin-bottom: 0.15rem; font-size: 0.6rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.6rem;
    transition: background 0.15s;
}

.btn-primary { background-color: var(--ml-purple); color: white; }
.btn-primary:hover { background-color: var(--ml-blue); }
.btn-secondary { background-color: var(--ml-lavender3); color: var(--ml-purple); }
.btn-secondary:hover { background-color: var(--ml-lavender); }

/* Week Sections */
.week-section { margin-bottom: 0.15rem; }

.week-header {
    background-color: var(--ml-lavender4);
    padding: 0.2rem 0.3rem;
    border-left: 2px solid var(--ml-purple);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.week-header h3 { margin: 0; font-size: 0.7rem; }
.week-header:hover { background-color: var(--ml-lavender3); }

.week-content {
    padding: 0.2rem 0.3rem;
    background: white;
    border: 1px solid var(--ml-lavender3);
    border-top: none;
}

.week-content p { margin-bottom: 0.15rem; font-size: 0.6rem; }

/* PDF List */
.pdf-list { list-style: none; }

.pdf-item {
    display: flex;
    align-items: center;
    padding: 0.1rem 0.2rem;
    border-bottom: 1px solid var(--ml-lavender4);
    gap: 0.2rem;
    transition: background 0.1s;
}

.pdf-item:last-child { border-bottom: none; }
.pdf-item:hover { background-color: var(--ml-lavender4); }

.pdf-icon {
    width: 18px;
    height: 18px;
    background-color: var(--ml-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-weight: bold;
    font-size: 0.5rem;
}

.pdf-info { flex: 1; }
.pdf-name { font-weight: 600; color: var(--ml-purple); font-size: 0.65rem; }
.pdf-meta { font-size: 0.55rem; color: var(--ml-gray); }

/* Figure Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.15rem;
}

.gallery-item {
    background: white;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: transform 0.1s;
}

.gallery-item:hover { transform: scale(1.02); }
.gallery-item img {
    width: 100%;
    height: 60px;
    object-fit: contain;
    background-color: var(--ml-lavender4);
    padding: 0.15rem;
}

.gallery-item p {
    padding: 0.1rem;
    text-align: center;
    font-size: 0.55rem;
    color: var(--ml-gray);
}

/* Filter Buttons */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    margin-bottom: 0.2rem;
}

.filter-btn {
    padding: 0.1rem 0.25rem;
    border: 1px solid var(--ml-lavender);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.55rem;
    transition: all 0.1s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--ml-purple);
    color: white;
    border-color: var(--ml-purple);
}

/* Learning Goals */
.goal-list { list-style: none; }

.goal-item {
    display: flex;
    gap: 0.2rem;
    padding: 0.2rem;
    margin-bottom: 0.15rem;
    background: white;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.goal-number {
    width: 16px;
    height: 16px;
    background-color: var(--ml-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 0.6rem;
}

/* Footer */
footer {
    background-color: var(--ml-dark);
    color: white;
    text-align: center;
    padding: 0.2rem;
    font-size: 0.6rem;
}

footer a { color: var(--ml-lavender); }

.toggle-icon { font-size: 0.75rem; font-weight: bold; color: var(--ml-purple); }

/* Figure cards (for figures.html) */
.figure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.2rem;
}

.figure-card {
    background: white;
    border-radius: 2px;
    padding: 0.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    transition: box-shadow 0.15s;
}

.figure-card:hover { box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.figure-name { font-weight: 600; color: var(--ml-purple); font-size: 0.65rem; word-break: break-word; }
.figure-category { font-size: 0.55rem; color: var(--ml-gray); }

/* Search bar */
.search-bar {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-bar input {
    flex: 1;
    min-width: 150px;
    padding: 0.2rem 0.3rem;
    border: 1px solid var(--ml-lavender);
    border-radius: 3px;
    font-size: 0.65rem;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--ml-purple);
}

.figure-count {
    background: var(--ml-lavender3);
    padding: 0.15rem 0.3rem;
    border-radius: 10px;
    font-size: 0.6rem;
    color: var(--ml-purple);
}

.no-results {
    text-align: center;
    padding: 0.5rem;
    color: var(--ml-gray);
    font-size: 0.65rem;
}

/* Responsive - hide sidebar on mobile */
@media (max-width: 600px) {
    nav {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 0.3rem;
    }
    nav .nav-title { display: none; }
    nav ul { flex-direction: row; flex-wrap: wrap; gap: 0.2rem; }
    .page-wrapper { margin-left: 0; }
    body { flex-direction: column; }
    .card-grid { grid-template-columns: 1fr; }
}
