@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&display=swap');

/* ============================================
   RESET & BASE
   ============================================ */

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

body {
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    background-color: #363636;
    color: #fff;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */

.editor-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* ============================================
   ÉDITEUR DE TEXTE - ALIGNÉ À GAUCHE
   ============================================ */

.editor-wrapper {
    flex: 1;
    overflow: auto;
    padding: 0;
    background-color: #363636;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.text-editor {
    max-width: 800px;
    width: 100%;
    min-height: 100%;
    padding: 60px;
    padding-top: 120px;
    margin-top: 0;
    font-size: 17px;
    line-height: 1.6;
    color: #ffffff !important;
    outline: none;
    word-wrap: break-word;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: left;
}

.control-btn {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
}

.control-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .text-editor {
        padding: 60px 40px;
        padding-top: 120px;
    }
    
    .controls-header {
        padding: 6px 12px;
        gap: 5px;
    }
    
    .controls-row {
        gap: 8px;
    }
    
    .controls-left {
        gap: 8px;
    }
    
    .control-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .control-label {
        font-size: 12px;
    }
    
    .tool-btn {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 28px;
        height: 28px;
    }
    
    .size-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .text-editor {
        padding: 60px 20px;
        padding-top: 120px;
    }
    
    .controls-header {
        padding: 5px 10px;
        gap: 4px;
    }
    
    .controls-row {
        gap: 6px;
    }
    
    .controls-left {
        gap: 6px;
    }
    
    .control-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .control-label {
        font-size: 11px;
    }
    
    .tool-btn {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 24px;
        height: 24px;
    }
    
    .size-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* Interlignes pour tous les éléments */
.text-editor p {
    line-height: 1.6;
    margin-bottom: 0.5em;
}

.text-editor h1,
.text-editor h2,
.text-editor h3,
.text-editor h4,
.text-editor h5,
.text-editor h6 {
    line-height: 1.5;
    margin-bottom: 0.5em;
}

.text-editor li {
    line-height: 1.6;
}

/* Forcer la couleur blanche sur tous les éléments */
.text-editor * {
    color: #ffffff !important;
}

/* Éléments de liste */
.text-editor ul,
.text-editor ol {
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
    color: #ffffff !important;
}

.text-editor li {
    margin-bottom: 4px;
    color: #ffffff !important;
}

/* Titres */
.text-editor h1,
.text-editor h2,
.text-editor h3,
.text-editor h4,
.text-editor h5,
.text-editor h6 {
    color: #ffffff !important;
}

.text-editor h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    color: #ffffff !important;
}

/* Autres éléments */
.text-editor p {
    color: #ffffff !important;
}

.text-editor span {
    color: #ffffff !important;
}

.text-editor div {
    color: #ffffff !important;
}

.text-editor strong {
    font-weight: 600;
    color: #ffffff !important;
}

.text-editor em {
    font-style: italic;
    color: #ffffff !important;
}

.text-editor a {
    color: #ffffff !important;
}

/* Sélection */
.text-editor::selection {
    background-color: rgba(74, 158, 255, 0.3);
    color: #fff;
}

.text-editor::-moz-selection {
    background-color: rgba(74, 158, 255, 0.3);
    color: #fff;
}

/* ============================================
   HEADER DE CONTRÔLES COMPACT EN HAUT
   ============================================ */

.controls-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background-color: #363636;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.controls-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.controls-row-1 {
    justify-content: space-between;
    flex-wrap: nowrap;
}

.controls-row-2 {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 1;
    min-width: 0;
}

.controls-right {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.control-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    white-space: nowrap;
}

.control-btn {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
}

.control-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.05);
}

.control-btn.active,
.mode-btn.active {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.05);
}

.share-mode-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.mode-btn {
    text-align: center;
}

.format-tools {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

.size-controls {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

.size-btn {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
}

.size-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.05);
}

.tool-btn {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.05);
}

.tool-btn.active {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.1);
}

.tool-btn strong {
    font-weight: 700;
}

.tool-btn em {
    font-style: italic;
}

/* ============================================
   SCROLLBAR
   ============================================ */

.editor-wrapper::-webkit-scrollbar {
    width: 8px;
}

.editor-wrapper::-webkit-scrollbar-track {
    background: #363636;
}

.editor-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.editor-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   OVERLAY DE CONNEXION
   ============================================ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #363636;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-overlay.hidden {
    display: none;
}

.login-container {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    min-width: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.login-input {
    width: 280px;
    padding: 10px 12px;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: #ffffff;
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 14px;
    margin-bottom: 0;
    outline: none;
    box-sizing: border-box;
    text-align: center;
}

.login-input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-btn {
    width: 280px;
    padding: 10px 12px;
    background-color: transparent;
    border: none;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.login-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.login-error {
    margin-top: 16px;
    color: rgba(255, 100, 100, 0.7);
    font-family: 'Geist Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    min-height: 20px;
}
