/* =============================================
   CODE VIEWER MODAL STYLES
   ============================================= */
.code-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.code-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.code-modal {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.code-modal-overlay.active .code-modal {
    transform: scale(1);
}

.code-modal-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-modal-title {
    font-weight: 600;
    font-size: 16px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-modal-title::before {
    content: '< />';
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #63b3ed;
}

.code-modal-close {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
}

.code-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.code-modal-info {
    padding: 12px 20px;
    background: #edf2f7;
    color: #4a5568;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
}

.code-modal-info strong {
    color: #2d3748;
}

.code-tabs {
    display: flex;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    padding: 0 8px;
}

.code-tab {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.code-tab:hover {
    color: var(--idealo-blue, #0771d0);
    background: #edf2f7;
}

.code-tab.active {
    color: var(--idealo-blue, #0771d0);
    border-bottom-color: var(--idealo-blue, #0771d0);
    background: var(--idealo-white, #ffffff);
}

.code-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.code-panel {
    display: none;
    flex: 1;
    overflow: auto;
    max-height: calc(90vh - 200px);
}

.code-panel.active {
    display: block;
}

.code-panel pre {
    margin: 0;
    padding: 20px;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #1e1e1e;
    color: #d4d4d4;
    overflow-x: auto;
    min-height: 100%;
}

.code-panel code {
    font-family: inherit;
}

/* Highlight.js VS Code Dark Theme */
.hljs {
    background: #1e1e1e;
    color: #d4d4d4;
}
.hljs-keyword { color: #569cd6; }
.hljs-built_in { color: #4ec9b0; }
.hljs-type { color: #4ec9b0; }
.hljs-literal { color: #569cd6; }
.hljs-number { color: #b5cea8; }
.hljs-string { color: #ce9178; }
.hljs-comment { color: #6a9955; font-style: italic; }
.hljs-function { color: #dcdcaa; }
.hljs-class { color: #4ec9b0; }
.hljs-variable { color: #9cdcfe; }
.hljs-attr { color: #9cdcfe; }
.hljs-tag { color: #569cd6; }
.hljs-name { color: #569cd6; }
.hljs-attribute { color: #9cdcfe; }
.hljs-selector-tag { color: #d7ba7d; }
.hljs-selector-class { color: #d7ba7d; }
.hljs-selector-id { color: #d7ba7d; }
.hljs-regexp { color: #d16969; }
.hljs-meta { color: #569cd6; }
.hljs-symbol { color: #b5cea8; }
.hljs-template-variable { color: #9cdcfe; }
.hljs-params { color: #9cdcfe; }
.hljs-title { color: #dcdcaa; }

/* Mode tab code button styling - always dark and visible */
.mode-tab--code {
    margin-left: auto;
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.mode-tab--code:hover {
    background: #333333 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

/* Keyboard shortcut hint */
.keyboard-hint {
    font-size: 11px;
    color: #a0aec0;
    margin-left: auto;
    padding-right: 8px;
}

.keyboard-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 10px;
}
