/* --- Variables de couleurs --- */
:root {
    --primary-color: #0078D4; /* Bleu Microsoft */
    --primary-hover: #005A9E;
    --bg-color: #F3F2F1;
    --card-bg: #FFFFFF;
    --text-main: #323130;
    --text-muted: #605E5C;
    --border-color: #EDEBE9;
    --code-bg: #1E1E1E;
    --code-text: #D4D4D4;
}

/* --- Reset de base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.back-link {
    text-decoration: none;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 16px;
    transition: 0.2s;
}

.back-link:hover {
    color: var(--primary-hover);
    transform: translateX(-5px); /* Petit effet de mouvement au survol */
}

.lang-switch { display: flex; gap: 5px; background: #eee; padding: 3px; border-radius: 6px; }
.lang-btn {
    border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-weight: bold;
    background: transparent; color: #666; transition: 0.2s;
}
.lang-btn.active { background: white; color: var(--primary-color); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* --- En-tête --- */
header {
    background-color: var(--card-bg);
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
    font-size: 24px;
    font-weight: 600;
}

header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Mise en page principale (Split-screen) --- */
.container {
    display: flex;
    gap: 20px;
    padding: 20px 40px;
    height: calc(100vh - 90px); /* Prend toute la hauteur moins le header */
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.controls-panel {
    flex: 1; /* Prend la moitié de l'espace */
    overflow-y: auto; /* Permet de scroller si on a beaucoup de choses */
    padding-right: 10px;
}

.preview-panel {
    flex: 1; /* Prend l'autre moitié */
}

/* --- Cartes de contrôles --- */
.card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 5px;
}

/* --- Formulaires et Boutons --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.form-group textarea {
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical; /* Permet à l'utilisateur d'agrandir la zone vers le bas */
    width: 100%;
}

.help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colonnes de boutons */
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Liste des ressources --- */
.resource-list {
    list-style-type: none;
}

.empty-msg {
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
}

/* --- Aperçu YAML --- */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-container {
    background-color: var(--code-bg);
    color: var(--code-text);
    padding: 20px;
    border-radius: 8px;
    flex-grow: 1;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

pre {
    margin: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    white-space: pre-wrap; /* Permet le retour à la ligne si le texte est trop long */
}

/* --- Styles pour les formulaires dynamiques des ressources --- */
.resource-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover {
    background: #c82333;
}

.resource-body .form-group {
    margin-bottom: 10px;
}

/* --- Carte transparente --- */
.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f0f0;
}
.drag-handle:active {
    cursor: grabbing !important;
}

/* --- Pied de page (Copyright) --- */
.site-footer {
    background-color: var(--card-bg, #ffffff);
    border-top: 1px solid var(--border-color, #e0e0e0);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    color: var(--text-muted, #666);
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
    font-weight: 500;
}

.footer-subtext {
    font-size: 12px;
    font-style: italic;
    opacity: 0.8;
}