/* ===================================
   АРХИВ ВАВИЛОНОВОЙ БИБЛИОТЕКИ
   Стилизация - Терминал Доступа
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #1a1a1a;
    --bg-darker: #0f0f0f;
    --text-light: #f0f0f0;
    --text-dim: #a0a0a0;
    --accent-gold: #FFD700;
    --accent-amber: #FFBF00;
    --accent-crimson: #800020;
    --accent-cyan: #40E0D0;
    --accent-blue: #4D8BFF;
    --border-gold: rgba(255, 215, 0, 0.3);
    --border-crimson: rgba(128, 0, 32, 0.3);
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Arial Narrow', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow: hidden;
    scrollbar-color: var(--accent-gold) rgba(255, 215, 0, 0.05);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 215, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-amber);
}

/* ====== PAGE WRAPPER ====== */
.page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ====== HEADER ====== */
.header {
    background-color: var(--bg-darker);
    border-bottom: 2px solid var(--accent-gold);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.1);
}

.header-seal {
    flex: 1;
    text-align: center;
}

.seal-circle {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255,215,0,0.05) 0%, transparent 70%);
}

.seal-eye {
    font-size: 28px;
    color: var(--accent-gold);
    animation: pulse-eye 2s infinite;
}

.seal-text-arc {
    font-size: 9px;
    font-family: 'Courier Prime', monospace;
    color: var(--accent-gold);
    letter-spacing: 2px;
}

@keyframes pulse-eye {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lang-btn, .sound-btn {
    background: none;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 8px 12px;
    cursor: pointer;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.lang-btn:hover, .sound-btn:hover {
    background-color: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.lang-btn.active {
    background-color: rgba(255, 215, 0, 0.2);
}

/* More visible language toggle (distinct from generic buttons) */
#lang-toggle {
    min-width: 84px;
    border-radius: 6px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255,215,0,0.06), rgba(255,215,0,0.02));
    border: 1px solid rgba(255,215,0,0.25);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4), 0 0 8px rgba(255,215,0,0.06) inset;
}

#lang-toggle .lang-display{
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    color: var(--accent-gold);
    letter-spacing: 1px;
}

#lang-toggle:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(255,215,0,0.12), rgba(255,215,0,0.04));
}

#lang-toggle.active {
    background: linear-gradient(180deg, rgba(255,215,0,0.18), rgba(255,215,0,0.06));
    box-shadow: 0 4px 16px rgba(255,215,0,0.12);
}

.sound-icon {
    font-size: 14px;
}

/* ====== MAIN LAYOUT ====== */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 10px;
    padding: 10px;
}

/* ====== SIDEBAR ====== */
.sidebar {
    width: 280px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    overflow-y: auto;
    padding: 20px;
    scrollbar-color: var(--accent-gold) rgba(255, 215, 0, 0.05);
    scrollbar-width: thin;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.nav-section {
    border-bottom: 1px solid var(--border-gold);
    padding-bottom: 15px;
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-title {
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 5px;
}

.nav-link:hover {
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
    padding-left: 14px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.nav-link.active {
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
    background-color: rgba(255, 215, 0, 0.1);
    font-weight: bold;
}

/* ====== CONTENT AREA ====== */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.document-frame {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-gold);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doc-header {
    background: linear-gradient(90deg, rgba(255,215,0,0.05) 0%, transparent 100%);
    border-bottom: 1px dashed var(--accent-gold);
    padding: 10px 20px;
    font-size: 11px;
}

.doc-stamp {
    display: flex;
    justify-content: space-between;
    color: var(--accent-gold);
    font-family: 'Courier Prime', monospace;
    letter-spacing: 1px;
}

.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    padding-right: 30px;
}

/* Page panels for static content mode */
.page-panel{display:none}
.page-panel.active{display:block}

/* Development badge */
.dev-badge{
    display:inline-block;
    background: linear-gradient(90deg, rgba(128,0,32,0.18), rgba(255,215,0,0.06));
    color: var(--accent-crimson);
    border:1px solid rgba(128,0,32,0.12);
    padding:6px 10px;
    font-family: 'Courier Prime', monospace;
    font-size:12px;
    border-radius:6px;
    margin-bottom:12px;
}

/* Contact form styling */
#contact-form{display:flex;flex-direction:column;gap:10px;max-width:520px}
#contact-form input[type="text"], #contact-form input[type="email"], #contact-form textarea{
    background: rgba(255,255,255,0.03);
    border:1px solid rgba(255,215,0,0.06);
    padding:10px;border-radius:6px;color:var(--text-light);font-family:inherit
}
#contact-form button[type="submit"]{background:var(--accent-gold);color:#111;border:none;padding:10px 14px;border-radius:6px;cursor:pointer}
#contact-form button[type="submit"]:hover{filter:brightness(0.95)}

/* Image-like stylized frame for author reader chapter */
.image-frame{
    width:100%;max-width:700px;margin:20px auto;padding:18px;border-radius:12px;background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.2));
    border: 6px solid rgba(255,255,255,0.03);box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 0 30px rgba(255,215,0,0.03);
}
.image-frame .placeholder{
    width:100%;height:380px;background:repeating-linear-gradient(45deg, rgba(255,215,0,0.03) 0 6px, rgba(255,215,0,0.02) 6px 12px);display:flex;align-items:center;justify-content:center;color:var(--text-dim);font-family:'Courier Prime', monospace;font-size:14px;border-radius:6px
}



.doc-footer {
    border-top: 1px dashed var(--accent-gold);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'Courier Prime', monospace;
}

.footer-line {
    color: var(--accent-gold);
}

/* ====== CONTENT TYPOGRAPHY ====== */
.page-title {
    font-family: 'Courier Prime', monospace;
    font-size: 28px;
    color: var(--accent-gold);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.page-subtitle {
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.section-title {
    font-family: 'Courier Prime', monospace;
    font-size: 16px;
    color: var(--accent-gold);
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title.crimson {
    color: var(--accent-crimson);
    border-bottom-color: var(--border-crimson);
}

.section-title.cyan {
    color: var(--accent-cyan);
}

.section-title.blue {
    color: var(--accent-blue);
}

.rune-marker {
    display: inline-block;
    color: var(--accent-gold);
    margin-right: 8px;
    font-weight: bold;
}

p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-light);
}

.highlight-gold {
    color: var(--accent-gold);
    font-weight: bold;
    cursor: help;
    border-bottom: 1px dotted var(--accent-gold);
    transition: all 0.2s ease;
}

.highlight-gold:hover {
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.highlight-crimson {
    color: var(--accent-crimson);
    font-weight: bold;
}

.highlight-cyan {
    color: var(--accent-cyan);
}

.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    background: var(--bg-darker);
    color: var(--accent-gold);
    padding: 8px 12px;
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    left: 0;
    bottom: 125%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

ul, ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
}

code {
    background-color: rgba(255, 215, 0, 0.05);
    color: var(--accent-cyan);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
}

/* ====== STATUS BAR ====== */
.status-bar {
    background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, transparent 100%);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    color: var(--accent-gold);
}

.status-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.status-line:last-child {
    margin-bottom: 0;
}

.status-label {
    font-weight: bold;
    min-width: 150px;
}

.status-value {
    color: var(--text-light);
}

/* ====== CARDS/WIDGETS ====== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.card {
    background: rgba(255, 215, 0, 0.03);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.card-title {
    font-family: 'Courier Prime', monospace;
    color: var(--accent-gold);
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-content {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

/* ====== FOOTER WITH CONSOLE ====== */
.footer {
    background-color: var(--bg-darker);
    border-top: 2px solid var(--accent-gold);
    display: flex;
    flex-direction: column;
    height: 180px;
    box-shadow: 0 -4px 12px rgba(255, 215, 0, 0.1);
}

.console-header {
    background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-gold);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.console-status {
    color: #00ff00;
    font-weight: bold;
}

.console-status.busy {
    color: var(--accent-gold);
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-light);
}

.console-output::-webkit-scrollbar {
    width: 6px;
}

.console-output::-webkit-scrollbar-track {
    background: rgba(255, 215, 0, 0.05);
}

.console-output::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 3px;
}

.console-line {
    margin-bottom: 4px;
    color: var(--text-light);
}

.console-line.success {
    color: #00ff00;
}

.console-line.error {
    color: #ff0000;
}

.console-line.warning {
    color: var(--accent-amber);
}

.console-line .highlight {
    color: var(--accent-cyan);
    font-weight: bold;
}

.console-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    border-top: 1px solid var(--border-gold);
    background: rgba(255, 215, 0, 0.02);
}

.console-prompt {
    color: var(--accent-gold);
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    font-weight: bold;
}

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    outline: none;
}

.console-input::placeholder {
    color: var(--text-dim);
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 1200px) {
    .sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .footer {
        height: 150px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .content-container {
        padding: 20px;
    }
}

/* ====== ANIMATIONS ====== */
@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
    }
    20%, 24%, 55% {
        opacity: 0.7;
    }
}

.flicker-text {
    animation: flicker 0.15s infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }
}

.glow-text {
    animation: glow 2s infinite;
}

/* ====== HIDDEN ELEMENTS ====== */
.hidden-content {
    display: none;
}

/* ====== FORM STYLES ====== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-gold);
    font-size: 13px;
    font-family: 'Courier Prime', monospace;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px;
    background: rgba(255, 215, 0, 0.03);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    color: var(--text-light);
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    background: rgba(255, 215, 0, 0.05);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-button {
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
    color: var(--bg-dark);
    border: none;
    border-radius: 4px;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.form-button:hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}
