/* ========================== VARIABLES GLOBALES ========================== */
:root {
    --primary-color: #00a99f;
    --primary-hover: #007f75;
    --secondary-color: #607d8b;
    --secondary-hover: #4f6875;
    --background-dark: #1a2531;
    --background-card: rgba(40, 44, 52, 0.7);
    --background-sidebar: rgba(26, 37, 49, 0.95);
    --text-light: #f0f0f0;
    --text-secondary: #ccc;
    --text-highlight: #00a99f;
    --text-tag: #ff9800; 
    --text-attribute: #4caf50;
    --text-value: #e91e63;
    --tag-hover-bg: rgba(0, 169, 159, 0.15);
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    --transition-speed: 0.3s;
}

/* ========================== RESET & GÉNÉRAL ========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========================== ENTÊTE ========================== */
header, .top-header {
    text-align: center;
    padding: 1rem 0; /* Réduction du padding de l'en-tête */
}

.top-header h1 {
    font-size: 28px; /* Réduction de la taille */
    color: #ffffff;
    padding: 8px 16px; /* Réduction du padding */
    border-radius: 8px;
    background: linear-gradient(145deg, #1f2a38, #0f1923);
    box-shadow: inset 0 0 10px rgba(0, 169, 159, 0.3), 0 0 10px rgba(0,0,0,0.7);
    border: 2px solid var(--primary-color);
    display: inline-block;
    margin-bottom: 0.3rem; /* Réduction de la marge */
}

.top-header p {
    font-size: 14px; /* Réduction de la taille */
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

/* ========================== CONTENEUR PRINCIPAL ========================== */
.content-container {
    flex: 1;
    width: 95%;
    max-width: 1600px;
    margin: 0 auto 1rem; /* Réduction de la marge bottom */
    background: linear-gradient(135deg, #2e3b4e, #1a2531);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* ========================== LAYOUT DE L'EXPLORATEUR ========================== */
.explorer-layout {
    display: flex;
    height: calc(100vh - 120px); /* Réduction de la hauteur réservée à l'en-tête */
    min-height: 500px;
}

/* Menu toggle pour mobile */
.menu-toggle {
    display: none;
    padding: 0.6rem 1rem; /* Réduction du padding */
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    border-radius: 8px 8px 0 0;
    position: relative;
    z-index: 5;
}

.menu-toggle i {
    margin-right: 0.5rem;
}

/* ========================== SIDEBAR AVEC FICHIERS OPTIMISÉE ========================== */
.explorer-sidebar {
    width: 300px;
    background: var(--background-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    height: 100%;
    padding: 0.5rem; /* Réduction drastique du padding */
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
    /* Amélioration de la scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--background-sidebar);
}

/* Personnalisation scrollbar WebKit */
.explorer-sidebar::-webkit-scrollbar {
    width: 8px;
}

.explorer-sidebar::-webkit-scrollbar-track {
    background: var(--background-sidebar);
}

.explorer-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.explorer-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0; /* Réduction du padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem; /* Réduction de la marge */
    flex-shrink: 0; /* Empêche la compression */
}

.dayz-logo {
    width: 80px; /* Réduction de la taille du logo */
    height: auto;
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1rem; /* Réduction de la taille */
    color: var(--primary-color);
    margin-top: 0.3rem;
    text-align: center;
}

.sidebar-header h2 i {
    margin-right: 0.5rem;
}

/* Container pour la liste des fichiers - OPTIMISÉ */
.file-list-container {
    flex: 1; /* Prend tout l'espace disponible */
    overflow-y: auto;
    margin-bottom: 0.5rem; /* Réduction de la marge */
    min-height: 0; /* Important pour le flex */
}

.search-input {
    width: 100%;
    padding: 0.5rem; /* Réduction du padding */
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 0.9rem; /* Réduction de la taille */
    margin-bottom: 0.8rem; /* Réduction de la marge */
    transition: all var(--transition-speed);
    flex-shrink: 0;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(0, 169, 159, 0.2);
}

.file-list {
    list-style: none;
    padding: 0;
    margin-bottom: 0.5rem; /* Réduction de la marge */
}

.file-list li {
    margin-bottom: 0.3rem; /* Réduction de l'espacement */
}

.file-list a {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.6rem; /* Réduction du padding */
    color: var(--text-light);
    text-decoration: none;
    border-radius: 4px; /* Réduction du rayon */
    transition: all 0.2s ease;
    font-size: 0.9rem; /* Réduction de la taille de police */
}

.file-list a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.file-list a.active {
    background-color: var(--primary-color);
    color: white;
}

.file-list i {
    margin-right: 0.6rem; /* Réduction de la marge */
    font-size: 0.8rem;
}

/* Sections de la sidebar - COMPACTES */
.sidebar-section {
    padding: 0.5rem 0; /* Réduction du padding */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-section h3 {
    color: var(--text-highlight);
    font-size: 0.9rem; /* Réduction de la taille */
    margin-bottom: 0.5rem; /* Réduction de la marge */
    display: flex;
    align-items: center;
}

.sidebar-section h3 i {
    margin-right: 0.5rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem; /* Réduction du gap */
}

.option-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem; /* Réduction de la taille */
}

.option-toggle input {
    margin-right: 0.6rem; /* Réduction de la marge */
}

/* ========================== ZONE PRINCIPALE DE CONTENU ========================== */
.explorer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.file-content-display {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: rgba(25, 35, 45, 0.8);
    position: relative;
}

/* Écran d'accueil */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.welcome-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.welcome-screen h2 {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.welcome-screen p {
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 0.5rem;
}

/* ========================== AFFICHAGE DU CODE XML ========================== */
.xml-container {
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.4;
    background: rgba(15, 25, 35, 0.95);
    padding: 1rem;
    border-radius: 8px;
    position: relative;
    white-space: pre-wrap;
    word-break: break-all;
}
.json-content {
    background-color: var(--dark); /* ou #1e1e1e */
    color: var(--text-light);      /* ou #ddd */
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.json-key {
    color: var(--text-tag); /* par ex : #7ec699 */
}

.json-value-string {
    color: #ce9178;
}

.json-value-number {
    color: #b5cea8;
}

.json-value-boolean {
    color: #569cd6;
}

.json-value-null {
    color: #9cdcfe;
}


.file-link.xml-file { color: #2ecc71; }
.file-link.json-file { color: #3498db; }


.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    padding: 1rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.3);
    text-align: right;
    user-select: none;
    font-size: 0.9rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.xml-content {
    padding-left: 3rem;
}

/* Styles pour coloration syntaxique */
.xml-tag {
    color: var(--text-tag);
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    position: relative;
}

.xml-tag:hover {
    background-color: var(--tag-hover-bg);
}

.xml-attribute {
    color: var(--text-attribute);
}

.xml-value {
    color: var(--text-value);
}

.xml-text {
    color: var(--text-light);
}

.xml-comment {
    color: #777;
    font-style: italic;
}

/* ========================== PANNEAU DE DÉTAILS DES BALISES ========================== */
.tag-details-panel {
    position: relative;
    background-color: var(--background-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    height: 150px;
    overflow-y: auto;
    padding: 1rem;
    transition: height 0.3s ease;
    backdrop-filter: blur(5px);
}

.panel-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: var(--primary-color);
    opacity: 0.7;
    cursor: ns-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.tag-details-panel h3 {
    color: var(--primary-color);
    margin-top: 0.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.tag-details-panel table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.tag-details-panel table th {
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    color: var(--primary-color);
}

.tag-details-panel table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================== TOOLTIP POUR MOBILE ========================== */
.mobile-tooltip {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-card);
    border-top: 2px solid var(--primary-color);
    padding: 1rem;
    z-index: 100;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-tooltip.visible {
    transform: translateY(0);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.tooltip-header h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.has-tooltip {
    cursor: help;
}


#closeTooltip {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
}

/* ========================== BOUTONS ========================== */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem; /* Réduction du gap */
    padding: 0.6rem 0.8rem; /* Réduction du padding */
    border-radius: 6px; /* Réduction du rayon */
    font-weight: bold;
    text-decoration: none;
    transition: all var(--transition-speed);
    cursor: pointer;
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100%;
    font-size: 0.85rem; /* Réduction de la taille */
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* ========================== PIED DE PAGE ========================== */
.main-footer {
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4));
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================== STYLES DE PLIAGE DU XML ========================== */
.collapsible {
    cursor: pointer;
}

.collapsed .xml-content {
    display: none;
}

.collapse-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 5px;
    transition: transform 0.2s ease;
    text-align: center;
    line-height: 14px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* ========================== MEDIA QUERIES ========================== */
@media screen and (max-width: 1100px) {
    .explorer-layout {
        height: calc(100vh - 100px); /* Optimisation pour les écrans moyens */
    }
}

@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .explorer-layout {
        flex-direction: column;
        height: auto;
    }

    .explorer-sidebar {
        width: 100%;
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 10;
        height: 300px;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }

    .explorer-sidebar.visible {
        transform: translateY(0);
    }

    .explorer-content {
        height: calc(100vh - 200px);
    }

    .tag-details-panel {
        height: 120px;
    }

    .mobile-tooltip {
        display: block;
    }
}

@media screen and (max-width: 576px) {
    .content-container {
        width: 100%;
        border-radius: 0;
    }

    .top-header h1 {
        font-size: 20px; /* Encore plus petit sur mobile */
        padding: 6px 12px;
    }

    .xml-container {
        font-size: 0.9rem;
    }

    .line-numbers {
        width: 2rem;
        font-size: 0.8rem;
    }

    .xml-content {
        padding-left: 2.5rem;
    }

    .tag-details-panel {
        height: 100px;
    }
}

/* ========================== STYLES POUR LE RÉPERTOIRE DES BALISES ========================== */
.repertoire-layout {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.repertoire-sidebar {
    width: 300px;
    background: var(--background-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
}

.tags-list-container {
    max-height: 80vh;
    overflow-y: auto;
}

.tags-list li {
    transition: all 0.2s ease-in-out;
    margin-bottom: 0.3rem;
}

.tags-list li.hidden {
    display: none !important;
}

.tag-link {
    display: block;
    padding: 0.5rem 0.8rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Monaco', monospace;
}

.tag-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.tag-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.repertoire-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: rgba(25, 35, 45, 0.8);
}

.intro-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(15, 25, 35, 0.8);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.intro-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tag-detail-card {
    background: linear-gradient(160deg, #2e2e2e 0%, #1c1c1c 100%);
    background-blend-mode: overlay;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.tag-detail-card.highlight {
    box-shadow: 0 0 30px var(--primary-color);
    transform: translateY(-5px);
}

.tag-title {
    color: var(--primary-color);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tag-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-section h3 {
    color: var(--text-highlight);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.attributes-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.attributes-table th {
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.attributes-table td {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.attributes-table code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.children-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.children-list li {
    margin-bottom: 0.5rem;
}

.children-list a {
    color: var(--text-light);
    text-decoration: none;
}

.children-list code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: all 0.2s ease;
    display: inline-block;
}

.children-list code:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.tag-example {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary-color);
}

.file-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.file-badge i {
    margin-right: 0.4rem;
    color: var(--primary-color);
}

.file-badge:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.file-badge:hover i {
    color: white;
}

/* ========================== STYLES POUR L'AFFICHAGE DES FICHIERS XML ========================== */
.file-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.file-header h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.file-header h2 i {
    margin-right: 0.5rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: var(--primary-color);
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
}

.loading-indicator i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(220, 53, 69, 0.1);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.error-message i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-message h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

/* Styles pour la mise en évidence au survol des balises */
.xml-tag:hover + .tag-tooltip,
.xml-tag:hover::after {
    display: block;
    opacity: 1;
}

.file-header {
    position: sticky;
    top: 0;
    background: rgba(25, 35, 45, 0.95);
    z-index: 10;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ajustements spécifiques pour le mobile */
@media screen and (max-width: 768px) {
    .repertoire-layout {
        flex-direction: column;
        height: auto;
    }
    
    .repertoire-sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .tag-detail-card {
        padding: 1rem;
    }
    
    .tag-title {
        font-size: 1.5rem;
    }
    
    .attributes-table {
        font-size: 0.9rem;
    }
    
    .attributes-table th,
    .attributes-table td {
        padding: 0.5rem;
    }
    
    .tag-example {
        max-width: 100%;
        font-size: 0.9rem;
    }
}
.fold-toggle {
    display: inline-block;
    width: 16px;
    height: 16px;
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    user-select: none;
}

.foldable-content {
    transition: height 0.2s ease;
}

/* Dans votre fichier CSS */
@font-face {
    font-family: 'Segoe UI';
    src: url('../assets/fonts/segoe-ui-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Segoe UI';
    src: url('../assets/fonts/segoe-ui-semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Segoe UI';
    src: url('../assets/fonts/segoe-ui-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}