/* Layout Structure */
#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #00665c;
    /* Dark Jade */
    margin-bottom: 2.5rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
    border: 1px solid transparent;
    margin-bottom: 0.5rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(5px);
    color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    color: var(--primary);
    box-shadow:
        0 10px 20px -5px rgba(59, 130, 246, 0.15),
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 1);
    transform: scale(1.02);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 4rem 2rem;
    max-width: 1600px;
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #00665c;
}

.header-brand img {
    height: 35px;
    border-radius: 4px;
}

/* Hamburger Menu Icon */
#menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger {
    position: relative;
    width: 24px;
    height: 2px;
    background: #00665c;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #00665c;
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.sidebar.open+.mobile-header .hamburger {
    background: transparent;
}

.sidebar.open+.mobile-header .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.sidebar.open+.mobile-header .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumbs span::after {
    content: '›';
    margin-left: 0.5rem;
    color: #cbd5e1;
}

.breadcrumbs span:last-child::after {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        width: 80%;
        max-width: 300px;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    }

    html[dir="rtl"] .sidebar {
        transform: translateX(100%);
        box-shadow: -20px 0 50px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
        /* Space for fixed mobile header */
    }

    html[dir="rtl"] .main-content {
        margin-right: 0;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* RTL Support */
html[dir="rtl"] {
    text-align: right;
}

html[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

html[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: 280px;
}

html[dir="rtl"] .nav-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumbs span::after {
    content: '‹';
    margin-left: 0;
    margin-right: 0.5rem;
}

html[dir="rtl"] .nav-item:hover {
    transform: translateX(-5px);
}

/* Tutorial Overlay */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
    display: none;
}

.tutorial-spotlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 1001;
    pointer-events: none;
}

.tutorial-card {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    z-index: 1100;
    padding: 2rem;
    pointer-events: auto;
    text-align: center;
}

.tutorial-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.tutorial-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.tutorial-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

html[dir="rtl"] .btn i,
html[dir="rtl"] .nav-item i {
    margin-left: 0.5rem;
    margin-right: 0;
}