/* ============================== */
/* BASE STYLES (RESTORED)         */
/* ============================== */

:root {
    /* Blackboard Palette */
    --primary: #2F5D62;
    --primary-dark: #1F4044;
    --secondary: #5d4037;
    --accent: #ECB390;
    --bg-color: #2b3a28;
    --surface: #3e4e3b;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-soft: rgba(255, 255, 255, 0.9);
    --border-color: rgba(255, 255, 255, 0.2);
    --success: #4ade80;
    --error: #f87171;
    --warning: #fbbf24;
    --font-heading: 'Merriweather', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: #5d4037;
    background-image: url('https://www.transparenttextures.com/patterns/wood-pattern.png');
    color: var(--text-main);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #3e2723;
}

::-webkit-scrollbar-thumb {
    background: #8d6e63;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1887f;
}

/* ============================== */
/* LAYOUT                         */
/* ============================== */

.app-layout {
    display: flex;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Sidebar - Wood Frame Style */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: #3e2723;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    color: white;
    border: 4px solid #4e342e;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        5px 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    height: calc(100vh - 2rem);
    flex-shrink: 0;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://www.transparenttextures.com/patterns/wood-pattern.png');
    opacity: 0.5;
    pointer-events: none;
    border-radius: 8px;
}

.sidebar>* {
    position: relative;
    z-index: 1;
}

/* Sidebar Header - Fixed */
.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    color: var(--accent);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

/* Nav Menu - Scrollable */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.nav-menu::-webkit-scrollbar {
    width: 5px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    background: none;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed var(--accent);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-item i {
    width: 20px;
    height: 20px;
}

/* User Profile - Fixed at Bottom */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3e2723;
    font-weight: bold;
}

.user-info h4 {
    font-size: 0.9rem;
    color: white;
}

.user-info p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content - Chalkboard */
.main-content {
    flex: 1;
    background-color: #2b3a28;
    border-radius: 12px;
    border: 8px solid #4e342e;
    position: relative;
    overflow-y: auto;
    box-shadow:
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        5px 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    min-width: 0;
}

.main-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://www.transparenttextures.com/patterns/black-scales.png');
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.main-content>* {
    position: relative;
    z-index: 1;
}

/* ============================== */
/* BUTTONS                        */
/* ============================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    font-family: var(--font-heading);
    background: none;
}

.btn-primary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent);
    color: #3e2723;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================== */
/* UTILITIES                      */
/* ============================== */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hover-scale {
    transition: transform 0.2s;
}

.hover-scale:hover {
    transform: scale(1.02);
}