/* --- Font Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* --- General Body & Editor Styling --- */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(160deg, #0A0A0A 0%, #1A1A1A 100%); /* Dégradé sombre du corps */
    color: #E0E0E0; /* Texte clair */
    display: flex;
    flex-direction: column; /* Pour un layout en colonne (header, main) */
    min-height: 100vh;
    overflow: hidden; /* Empêche le défilement général */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Editor Header --- */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #1C1C1E; /* Fond sombre pour le header */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); /* Ombre pour le relief */
    z-index: 10; /* Assure que le header est au-dessus */
}

.editor-header h1 {
    font-size: 1.4em;
    color: #FFFFFF;
    margin: 0;
    flex-grow: 1; /* Permet au titre de prendre de la place */
    text-align: center; /* Centre le titre */
    white-space: nowrap; /* Empêche le retour à la ligne */
    overflow: hidden; /* Cache le texte qui dépasse */
    text-overflow: ellipsis; /* Ajoute des points de suspension */
}

.back-btn, .save-btn {
    background-color: transparent;
    border: none;
    color: #3BCC7A; /* Vert Kinema+ pour les icônes/texte des boutons */
    font-size: 1.1em;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px; /* Espace entre icône et texte */
}

.back-btn i, .save-btn i {
    font-size: 1.2em;
}

.back-btn:hover, .save-btn:hover {
    background-color: rgba(59, 204, 122, 0.15); /* Légère teinte verte au survol */
    transform: translateY(-1px);
}
.back-btn:active, .save-btn:active {
    transform: translateY(0);
}

/* Specific save button style */
.save-btn {
    background-color: #2E8B57; /* Vert Kinema+ pour l'action principale */
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.save-btn:hover {
    background-color: #246B44; /* Vert plus foncé au survol */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.save-btn:active {
    background-color: #1A5432;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) inset;
}


/* --- Main Editor Area --- */
.editor-main {
    flex-grow: 1; /* Prend l'espace restant */
    padding: 20px;
    display: flex;
}

#projectContent {
    width: 100%;
    height: 100%; /* S'étend pour remplir l'espace disponible */
    padding: 15px;
    font-size: 1.05em;
    line-height: 1.6;
    background-color: #0F0F0F; /* Fond très sombre pour l'éditeur */
    color: #EAEAEA; /* Texte clair */
    border: 1px solid #333333;
    border-radius: 10px;
    resize: none; /* Empêche le redimensionnement manuel */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3); /* Ombre intérieure pour un effet "incrusté" */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 200px; /* Hauteur minimale si le flex ne fonctionne pas comme prévu */
}

#projectContent:focus {
    outline: none;
    border-color: #2E8B57; /* Bordure verte Kinema+ au focus */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(46, 139, 87, 0.3); /* Lueur verte */
}

/* --- Status Message (Save/Error) --- */
.status-message {
    position: fixed; /* Position fixe pour flotter */
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(46, 139, 87, 0.9); /* Fond vert semi-transparent */
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.status-message.show {
    opacity: 1;
    visibility: visible;
}

.status-message.error {
    background-color: rgba(204, 59, 59, 0.9); /* Rouge pour les erreurs */
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .editor-header {
        padding: 10px 15px;
    }
    .editor-header h1 {
        font-size: 1.2em;
    }
    .back-btn, .save-btn {
        font-size: 1em;
        padding: 6px 10px;
        gap: 5px;
    }
    .back-btn i, .save-btn i {
        font-size: 1.1em;
    }
    .editor-main {
        padding: 15px;
    }
    #projectContent {
        padding: 12px;
        font-size: 0.95em;
        border-radius: 8px;
    }
    .status-message {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .editor-header h1 {
        font-size: 1.1em;
    }
    .back-btn, .save-btn {
        font-size: 0.9em;
        padding: 5px 8px;
    }
    .back-btn i, .save-btn i {
        font-size: 1em;
    }
    .editor-main {
        padding: 10px;
    }
    #projectContent {
        padding: 10px;
        font-size: 0.9em;
    }
}
