/* ========================================
   LE MONT BÉLIEN - STYLES ÉDITEUR
   ======================================== */

.editor-page {
    min-height: 100vh;
    background: var(--color-parchment);
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER
   ======================================== */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--color-bg-dark);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-link {
    color: var(--color-cream);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--color-gold);
}

.editor-title {
    font-family: var(--font-gothic);
    font-size: 1.4rem;
    color: var(--color-cream);
    margin: 0;
}

.user-info {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-gold);
}

.btn-logout {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--color-cream);
    color: var(--color-cream);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--color-cream);
    color: var(--color-bg-dark);
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */
.editor-container {
    flex: 1;
    display: flex;
    position: relative;
}

/* ========================================
   SIDEBAR - LISTE DES POÈMES
   ======================================== */
.poems-sidebar {
    width: 280px;
    background: var(--color-bg-green);
    border-right: 3px solid var(--color-gold);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-family: var(--font-gothic);
    font-size: 1.2rem;
    color: var(--color-cream);
    margin: 0;
}

.btn-new {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: var(--color-gold);
    border: none;
    color: var(--color-bg-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-new:hover {
    background: var(--color-cream);
}

.poems-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.poem-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.poem-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.poem-item.active {
    background: rgba(201, 165, 77, 0.2);
    border-left-color: var(--color-gold);
}

.poem-item-title {
    font-family: var(--font-gothic);
    font-size: 1rem;
    color: var(--color-cream);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poem-item-date {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.poems-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-body);
    font-style: italic;
}

/* ========================================
   ÉDITEUR PRINCIPAL
   ======================================== */
.editor-main {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.poem-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--font-gothic);
    font-size: 1rem;
    color: var(--color-text);
}

#poemTitle {
    font-family: var(--font-gothic);
    font-size: 1.5rem;
    padding: 1rem;
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    background: var(--color-cream);
    color: var(--color-text);
    transition: border-color 0.3s ease;
}

#poemTitle:focus {
    outline: none;
    border-color: var(--color-red);
}

.content-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#poemContent {
    flex: 1;
    min-height: 400px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.8;
    padding: 1.5rem;
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    background: var(--color-cream);
    color: var(--color-text);
    resize: vertical;
    transition: border-color 0.3s ease;
}

#poemContent:focus {
    outline: none;
    border-color: var(--color-red);
}

#poemContent::placeholder,
#poemTitle::placeholder {
    color: #999;
    font-style: italic;
}

/* ========================================
   ACTIONS
   ======================================== */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.btn {
    font-family: var(--font-gothic);
    font-size: 1rem;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--color-red);
    color: var(--color-cream);
}

.btn-primary:hover {
    background: #9a3f32;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-bg-green);
    color: var(--color-cream);
}

.btn-secondary:hover {
    background: var(--color-bg-dark);
}

.btn-danger {
    background: #c0392b;
    color: white;
}

.btn-danger:hover {
    background: #a93226;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

/* ========================================
   STATUT DE SAUVEGARDE
   ======================================== */
.save-status {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem;
    text-align: center;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-status.success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    opacity: 1;
}

.save-status.error {
    background: rgba(192, 57, 43, 0.1);
    color: #c0392b;
    opacity: 1;
}

/* ========================================
   MESSAGES D'ERREUR
   ======================================== */
.error-message {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-red);
}

.error-message:empty {
    display: none;
}

/* ========================================
   ORNEMENT
   ======================================== */
.editor-ornament {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 60px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.5;
}

.editor-band {
    height: 200%;
    width: 100%;
    object-fit: cover;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-parchment);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    font-family: var(--font-gothic);
    font-size: 1.4rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.modal-content p {
    font-family: var(--font-body);
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .poems-sidebar {
        position: fixed;
        left: -280px;
        top: 60px;
        bottom: 0;
        z-index: 50;
        transition: left 0.3s ease;
    }

    .poems-sidebar.open {
        left: 0;
    }

    .editor-main {
        padding: 1.5rem;
    }

    .editor-ornament {
        display: none;
    }
}

@media (max-width: 600px) {
    .editor-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }

    .editor-title {
        order: -1;
        width: 100%;
        text-align: center;
        font-size: 1.2rem;
    }

    .header-left,
    .header-right {
        flex: 1;
    }

    .header-right {
        justify-content: flex-end;
    }

    .user-info {
        display: none;
    }

    .editor-main {
        padding: 1rem;
    }

    #poemContent {
        min-height: 300px;
    }

    .form-actions {
        flex-direction: column;
    }
}
