/* ── Notepad App ── */

#notepad-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #c0c0c0;
    font-family: 'Windows Regular', 'Arial', sans-serif;
    font-size: 11px;
    color: #000;
    user-select: none;
}

/* Toolbar Notepad – mêmes règles structurelles que Paint */
#notepad-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #c0c0c0;
    border-bottom: 2px solid #808080;
    padding: 3px 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Selects police & taille */
#notepad-fontfamily,
#notepad-fontsize {
    font-size: 11px;
    height: 20px;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    background: #ffffff;
    padding: 0 2px;
    cursor: pointer;
}

#notepad-fontfamily { width: 120px; }
#notepad-fontsize   { width: 46px; }

/* Couleur texte – même visuel que paint-current-color */
#notepad-current-color {
    width: 20px;
    height: 20px;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    background: #000;
    flex-shrink: 0;
    cursor: pointer;
}

/* Input natif : caché, sert uniquement à ouvrir le color picker du navigateur
   quand on clique sur #notepad-current-color (cf. notepad.js) */
#notepad-color-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Boutons G / I / S : même carré que .paint-tool-btn, largeur réduite */
#notepad-bold-btn,
#notepad-italic-btn,
#notepad-underline-btn {
    width: 26px;
    font-size: 13px;
}

/* Zone d'édition rich text */
#notepad-editor-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #808080;
    padding: 4px;
}

#notepad-editor {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    background: #ffffff;
    color: #000000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.6;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    outline: none;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
    cursor: text;
}

#notepad-editor:empty::before {
    content: attr(data-placeholder);
    color: #808080;
    pointer-events: none;
}

/* Barre de statut */
#notepad-statusbar {
    padding: 2px 6px;
    background: #c0c0c0;
    border-top: 1px solid #808080;
    flex-shrink: 0;
}

#notepad-status {
    font-size: 11px;
    color: #000;
    font-family: 'Windows Regular', 'Arial', sans-serif;
}

/* ── Barre grise du haut : Sauvegarder / Envoyer par mail ── */

#notepad-topbar {
    display: flex;
    gap: 6px;
    align-items: center;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 4px 6px;
    flex-shrink: 0;
}

#notepad-topbar button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    font-family: 'Windows Regular', 'Arial', sans-serif;
    font-size: 12px;
    padding: 3px 10px;
    cursor: pointer;
    color: #000;
}

#notepad-topbar button:active {
    border-top-color: #808080;
    border-left-color: #808080;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}

#notepad-topbar button img {
    pointer-events: none;
}

/* ── WordPad 95 – Ruler ── */

#wordpad-ruler {
    height: 22px;
    background: #c0c0c0;
    border-bottom: 2px solid #808080;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

#wordpad-ruler-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    /* Minor ticks every 10px (3px tall) */
    background-image:
        repeating-linear-gradient(90deg, transparent 0px, transparent 9px, #808080 9px, #808080 10px),
        repeating-linear-gradient(90deg, transparent 0px, transparent 49px, #404040 49px, #404040 50px),
        repeating-linear-gradient(90deg, transparent 0px, transparent 99px, #000 99px, #000 100px);
    background-size: 10px 5px, 50px 10px, 100px 14px;
    background-position: left bottom, left bottom, left bottom;
    background-repeat: repeat-x;
}

/* ── WordPad 95 – Overrides for page-like editor ── */

#notepad-editor-area {
    background: #808080 !important;
    padding: 10px 16px !important;
}

#notepad-editor {
    background: #ffffff !important;
    max-width: 700px;
    margin: 0 auto;
    min-height: 100%;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
    padding: 20px 24px !important;
    border: 1px solid #404040 !important;
}

/* Alignment buttons */
.wordpad-align-btn svg {
    display: block;
}
