/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #0f0;
    overflow: hidden;
}

/* ============================================
   CONTENEUR PRINCIPAL
   ============================================ */

.terminal-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #000;
}

/* ============================================
   SIDEBAR - FRÉQUENCES À GAUCHE
   ============================================ */

.sidebar {
    width: 280px;
    min-width: 280px;
    height: 100vh;
    background: #0a0a0a;
    border-right: 2px solid #0f0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    background: #000;
    border-bottom: 1px solid #0f0;
}

.sidebar-title {
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 2px;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    margin-bottom: 10px;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
    color: #0a0;
}

.frequency-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.frequency-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #111;
    position: relative;
}

.frequency-item:hover {
    background: #1a1a1a;
}

.frequency-item.active {
    background: #0a2a0a;
    border-left: 3px solid #0f0;
}

.frequency-item.locked {
    cursor: pointer;
    opacity: 0.7;
}

.frequency-item.locked.disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.frequency-item.locked.disabled:hover {
    background: #111;
}

.freq-frequency {
    font-size: 0.85em;
    color: #0a0;
    margin-bottom: 5px;
}

.freq-name {
    font-size: 1em;
    font-weight: bold;
    color: #0f0;
}

.frequency-item.locked .freq-name {
    color: #666;
}

.freq-role {
    font-size: 0.75em;
    margin-top: 5px;
    color: #666;
}

.frequency-item.active .freq-role {
    color: #0f0;
}

.sidebar-footer {
    padding: 15px 20px;
    background: #000;
    border-top: 1px solid #0f0;
}

.sidebar-counter {
    font-size: 0.9em;
    color: #0f0;
    margin-bottom: 5px;
}

.sidebar-version {
    font-size: 0.75em;
    color: #666;
}

/* ============================================
   MAIN AREA - CONTENU PRINCIPAL
   ============================================ */

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.title-bar {
    padding: 15px 20px;
    background: #0a0a0a;
    border-bottom: 2px solid #0f0;
}

.terminal-title {
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
}

.tabs-header {
    display: none;
}

.terminal-title {
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
}

.tabs-nav {
    display: none;
}

.tab-item {
    display: none;
}

/* ============================================
   BARRE DE STATUT
   ============================================ */

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #0a0a0a;
    border-bottom: 1px solid #0f0;
    font-size: 0.85em;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #0f0;
    border-radius: 50%;
    -webkit-animation: pulse 2s infinite;
    animation: pulse 2s infinite;
}

@-webkit-keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   CONTENU PRINCIPAL
   ============================================ */

.main-content {
    background: #000;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.tabs-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* ============================================
   CONTENU D'UN ONGLET
   ============================================ */

.tab-content {
    display: none;
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(-10px);
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SECTION VERROUILLÉE
   ============================================ */

.locked-section {
    text-align: center;
    padding: 10px 20px;
}

.locked-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: #333;
}

.locked-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #666;
}

.locked-subtitle {
    font-size: 0.95em;
    color: #444;
    margin-bottom: 30px;
}

.unlock-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #0a0a0a;
    border: 2px solid #0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #0f0;
    font-size: 0.9em;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #0f0;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 1em;
}

.form-group input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.btn {
    width: 100%;
    padding: 12px;
    background: #0a0a0a;
    border: 2px solid #0f0;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #0f0;
    color: #000;
}

.btn:active {
    transform: scale(0.98);
}

.btn.secondary {
    border-color: #666;
    color: #666;
}

.btn.secondary:hover {
    background: #666;
    color: #000;
}

/* ============================================
   SECTION DÉVERROUILLÉE
   ============================================ */

.unlocked-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    -webkit-animation: fadeIn 0.5s ease;
    animation: fadeIn 0.5s ease;
}

.npc-info-bar {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    background: #0a0a0a;
    border-bottom: 1px solid #0f0;
    font-size: 0.85em;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.npc-info-bar .info-item {
    display: flex;
    gap: 8px;
}

.npc-info-bar .info-label {
    color: #0a0;
    font-weight: bold;
}

.npc-info-bar .info-value {
    color: #0f0;
}

.npc-header {
    padding: 25px;
    background: #0a0a0a;
    border: 2px solid #0f0;
    margin-bottom: 25px;
}

.npc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    padding: 10px;
    background: #000;
    border-left: 3px solid #0f0;
}

.info-label {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1em;
    color: #0f0;
}

.npc-message {
    padding: 20px;
    background: #000;
    border: 1px solid #0f0;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ============================================
   SECTION ÉNIGME
   ============================================ */

.enigme-btn-container {
    margin: 30px 0;
}

.enigme-toggle-btn {
    padding: 20px 40px;
    background: #0a0a0a;
    border: 2px solid #0f0;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.enigme-toggle-btn:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.enigme-toggle-btn:active {
    transform: scale(0.98);
}

.enigme-section {
    margin-top: 12px;
    padding: 16px;
    background: #0a0a0a;
    border: 2px solid #0f0;
    display: flex;
    flex-direction: column;
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
    height: 80vh;
    min-height: 550px;
}

.enigme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #0f0;
    font-size: 0.9em;
}

.enigme-title {
    font-size: 1em;
    font-weight: bold;
}

.enigme-status {
    font-size: 0.75em;
    padding: 3px 10px;
    background: #000;
    border: 1px solid #0f0;
}

/* ============================================
   MESSAGES SYSTÈME
   ============================================ */

.system-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-left: 4px solid;
    -webkit-animation: slideIn 0.3s ease;
    animation: slideIn 0.3s ease;
}

@-webkit-keyframes slideIn {
    from {
        opacity: 0;
        -webkit-transform: translateX(-20px);
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.system-message.success {
    background: rgba(0, 255, 0, 0.1);
    border-left-color: #0f0;
    color: #0f0;
}

.system-message.error {
    background: rgba(255, 0, 0, 0.1);
    border-left-color: #f00;
    color: #f00;
}

.system-message.warning {
    background: rgba(255, 165, 0, 0.1);
    border-left-color: #fa0;
    color: #fa0;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #000;
    border: 1px solid #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.8;
}

.terminal-line {
    margin-bottom: 10px;
    word-wrap: break-word;
}

.prompt {
    color: #0a0;
    font-weight: bold;
}

.user-message {
    color: #0f0;
}

.response-message {
    color: #0f0;
}

.response-message .prompt {
    color: #f00;
}

/* ============================================
   SYSTÈME D'ERREUR
   ============================================ */

.system-error-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px;
    background: #0a0000;
    border: 2px solid #f00;
    height: 100%;
    animation: glitch 0.5s ease-in-out;
}

.error-header {
    font-size: 1.5em;
    font-weight: bold;
    color: #f00;
    text-align: center;
}

.error-blink {
    animation: blink 0.8s infinite;
}

@-webkit-keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0.3; }
}

@keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0.3; }
}

@-webkit-keyframes glitch {
    0% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

@keyframes glitch {
    0% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.error-content {
    background: #000;
    border: 1px solid #f00;
    padding: 20px;
}

.error-title {
    font-size: 1.3em;
    color: #f00;
    margin-bottom: 15px;
    font-weight: bold;
}

.error-message {
    color: #f66;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.error-code {
    color: #f00;
    font-size: 0.85em;
    font-weight: bold;
    border-top: 1px solid #f00;
    padding-top: 10px;
}

/* ============================================
   AMÉLIORATIONS VISUELLES
   ============================================ */

.terminal-line {
    margin-bottom: 10px;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in-out;
}

.msg-timestamp {
    color: #0a0;
    font-size: 0.85em;
    margin-right: 8px;
}

.msg-prompt {
    color: #f00;
    font-weight: bold;
}

.response-message.msg-new {
    background: rgba(0, 255, 0, 0.05);
    padding: 4px 8px;
    border-left: 2px solid #0f0;
}

.response-message.msg-new .msg-timestamp {
    color: #0f0;
    font-weight: bold;
}

.locked-section {
    animation: fadeIn 0.4s ease-in-out;
}

.enigme-content {
    padding: 14px;
    background: #000;
    border: 1px solid #0f0;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 12px;
    font-size: 1em;
    flex: 0 1 50%;
    overflow-y: auto;
}

.enigme-hints-separator {
    height: 2px;
    background: linear-gradient(90deg, transparent, #0f0, transparent);
    margin: 10px 0;
}

.enigme-hints-label {
    font-size: 0.8em;
    color: #0a0;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.enigme-hints {
    margin: 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hint-item {
    padding: 8px;
    background: #0a0a0a;
    border-left: 3px solid #666;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.hint-item.unlocked {
    border-left-color: #0f0;
    background: rgba(0, 255, 0, 0.05);
}

.hint-text {
    color: #0f0;
    line-height: 1.4;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .tabs-nav {
        flex-wrap: wrap;
    }
    
    .tab-item {
        min-width: 150px;
    }
    
    .tabs-content {
        padding: 15px;
    }
    
    .npc-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SCROLLBAR CUSTOM
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #0f0;
}

::-webkit-scrollbar-thumb:hover {
    background: #0a0;
}

@-webkit-keyframes slideInRight {
    from {
        -webkit-transform: translateX(400px);
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateX(0);
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@-webkit-keyframes fadeOut {
    to {
        opacity: 0;
        -webkit-transform: translateX(400px);
        transform: translateX(400px);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}