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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* Background Layers */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: #0d1117;
    background-image: var(--bg-image-url);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(var(--bg-blur));
    transform: scale(1.05); /* Prevents blur white borders */
    transition: filter 0.3s ease, background-image 0.5s ease;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: rgba(15, 23, 42, var(--bg-overlay-opacity));
    transition: background-color 0.3s ease;
}

/* Main Layout App Structure */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}

/* Header & Top Navigation Bar */
header {
    height: 56px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 10;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-accent);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-accent-hover);
}

.icon-btn.active {
    background: rgba(var(--primary-accent-rgb), 0.2);
    color: var(--primary-accent);
}

.lang-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lang-btn:hover {
    background: rgba(var(--primary-accent-rgb), 0.25);
    border-color: var(--primary-accent);
}

/* Main Workspace Split (Sidebar + Editor Area) */
#workspace-area {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Bottom Status Bar */
#status-bar {
    height: 36px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
    z-index: 10;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.status-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.status-link:hover {
    color: var(--primary-accent);
    background: rgba(255, 255, 255, 0.08);
}

.kofi-link {
    color: #ff5e5b !important;
}

.kofi-link:hover {
    color: #ff8582 !important;
    background: rgba(255, 94, 91, 0.15) !important;
}

/* Focus / Zen Mode Active State */
body.zen-mode header,
body.zen-mode #status-bar,
body.zen-mode .toolbar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

body.zen-mode #sidebar-panel {
    display: none !important;
}

body.zen-mode #status-bar {
    transform: translateY(20px);
}

body.zen-mode #zen-exit-btn {
    display: flex !important;
}

#zen-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: none;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive Design Breakpoints for Mobile & Tablet */
@media (max-width: 768px) {
    header {
        height: auto;
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .brand-section {
        gap: 6px;
    }

    .brand-title {
        font-size: 0.95rem;
    }

    .brand-title img {
        height: 24px !important;
        width: 24px !important;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .lang-btn {
        padding: 3px 6px;
        font-size: 0.72rem;
    }

    #status-bar {
        height: auto;
        padding: 8px 10px;
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .status-group {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .status-link {
        font-size: 0.75rem;
    }
}
