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

html {
    scroll-behavior: smooth;
}

/* Transition fluide lors du changement de thème clair/sombre */
*,
*::before,
*::after {
    transition-property: background-color, border-color, color, fill, stroke, box-shadow;
    transition-duration: 200ms;
    transition-timing-function: ease;
}

/* Exclure les éléments animés pour éviter la désynchronisation */
*[style*="transition"],
.tab-item,
.focus-mode-panel,
.sidebar-accordion,
.lang-dropdown-menu,
.extra-menu-dropdown-content,
.modal,
.modal-content,
.pomodoro-popup,
[data-lucide],
.writing-progress-fill,
.progress-scene-segment {
    transition-property: none;
}

body {
    /* UI utilise Inter sans-serif pour lisibilité optimale des éléments d'interface */
    font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    flex-shrink: 0;
    height: 60px;
}

.app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    flex-shrink: 0;
    flex: 1;
}

.sidebar-versions {
    flex-shrink: 0;
    width: 280px;
}

.sidebar-versions.hidden {
    display: none;
}

.editor-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

textarea {
    resize: vertical;
}

/* ============================================
   GLOBAL SELECTION & SCROLLBARS
   ============================================ */

/* Sélection de texte aux couleurs du thème */
::selection {
    background: rgba(var(--primary-color-rgb), 0.25);
    color: inherit;
    text-shadow: none;
}

/* Scrollbars Standard (Firefox) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Scrollbars Webkist (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
    border: 2px solid transparent;
}

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