:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --header-height: 64px;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
    --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);
}

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

body {
    font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow: hidden;
    /* Prevent body scroll, use iframe/div scroll */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0.75rem;
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.75rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    color: var(--text-main);
    font-size: 0.8125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: default;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.nav-header:first-of-type {
    margin-top: 0;
    border-top: none;
}

.nav-header i {
    width: 18px;
    height: 18px;
    text-align: center;
    color: var(--text-muted);
}

.nav-link i.chevron {
    margin-left: auto;
    width: 16px;
    display: none;
    /* Hide chevrons if the menu is fixed */
}

/* Removed .nav-item.open .chevron rotation */

/* Sub-menu styling */
.nav-sub-list {
    list-style: none;
    padding-left: 1rem;
    padding-bottom: 0.5rem;
}

/* Removed interactive max-height for .nav-sub-list */

.nav-sub-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s;
    margin-bottom: 0.125rem;
}

.nav-sub-link:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-sub-link.active {
    color: var(--primary-color);
    background: #eef2ff;
}

.sub-category-title {
    padding: 0.75rem 1rem 0.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-nested-link {
    padding-left: 2rem !important;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

.top-bar {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 2rem;
    z-index: 5;
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropbtn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    color: var(--text-main);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.lang-dropbtn:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
}

.lang-dropbtn i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.lang-dropdown.active .chevron {
    transform: rotate(180deg);
}

.lang-dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    background-color: white;
    min-width: 160px;
    box-shadow: var(--shadow-md);
    z-index: 20;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
}

.lang-dropdown.active .lang-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-content a {
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.lang-dropdown-content a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.content-frame-container {
    flex: 1;
    position: relative;
}

#content-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}