/* ===== Nordic Dark Theme ===== */
:root {
    --bg-deep: #0a1628;
    --bg-card: #0f1f3a;
    --bg-input: #081020;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #64b5f6;
    --accent-hover: #90caf9;
    --success: #4ade80;
    --error: #f87171;
    --warning: #fbbf24;
    --border: rgba(255, 255, 255, 0.1);
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.validator-frame {
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}
.rune-decoration {
    font-size: 48px;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: -10px;
}
.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}
.lang-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.lang-btn:hover, .lang-btn.active {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
    font-weight: 600;
}

/* Buttons */
.btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--bg-deep); border: none; font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-home { background: rgba(100, 181, 246, 0.15); color: var(--accent); border: 1px solid var(--accent); }
.btn-home:hover { background: var(--accent); color: var(--bg-deep); }
.btn-small { padding: 6px 12px; font-size: 13px; }

.header-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

/* Editor */
.editor-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 14px;
}
textarea {
    width: 100%;
    min-height: 200px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 14px;
    padding: 16px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}
textarea:focus { border-color: var(--accent); }

.editor-stats {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: "Fira Code", monospace;
}

.actions {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}

/* Results */
.results-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
}
#result-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.badge-success { background: rgba(74, 222, 128, 0.2); color: var(--success); }
.badge-error { background: rgba(248, 113, 113, 0.2); color: var(--error); }
.badge-warning { background: rgba(251, 191, 36, 0.2); color: var(--warning); }

.message-item {
    padding: 10px;
    border-left: 3px solid var(--error);
    background: rgba(248, 113, 113, 0.05);
    margin-bottom: 8px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.message-item.warning {
    border-left-color: var(--warning);
    background: rgba(251, 191, 36, 0.05);
}
.message-item.success {
    border-left-color: var(--success);
    background: rgba(74, 222, 128, 0.05);
}
.message-text { flex: 1; }
.listen-msg-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.listen-msg-btn:hover {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
}

/* Frames */
.frame {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
}
.frame h2 { font-size: 18px; margin-bottom: 12px; }
.frame-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.notes-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.notebook-status { font-size: 12px; color: var(--text-muted); margin-top: 8px; min-height: 1.4em; }

.features-list {
    list-style: none;
    margin-bottom: 12px;
}
.features-list li {
    padding: 6px 0;
    font-size: 14px;
}

/* Listen Frame Button */
.listen-frame-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.listen-frame-btn:hover {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
}

/* What This Tool Does - 3 Columns */
.what-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.what-col {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}
.what-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.what-col h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--accent);
}
.what-col ul {
    list-style: none;
    font-size: 13px;
    color: var(--text-muted);
}
.what-col ul li {
    padding: 3px 0;
    padding-left: 16px;
    position: relative;
}
.what-col ul li::before {
    content: "•";
    position: absolute;
    left: 4px;
    opacity: 0.5;
}
.what-check { border-top: 3px solid var(--success); }
.what-suggest { border-top: 3px solid var(--warning); }
.what-nocheck { border-top: 3px solid var(--error); }

/* Transparency */
.transparency-frame {
    background: linear-gradient(145deg, #0f1f3a 0%, #0a1628 100%);
    border-left: 3px solid var(--accent);
}
.transparency-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    font-style: italic;
    padding-right: 40px;
}

/* Info Frame (Dates + UTC Clock) */
.info-frame {
    background: rgba(100, 181, 246, 0.05);
    border: 1px dashed rgba(100, 181, 246, 0.3);
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: center;
}
.info-item {
    padding: 8px;
}
.info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    font-family: "Fira Code", monospace;
}
.info-clock .info-value {
    font-size: 18px;
    letter-spacing: 1px;
}

/* Contact & Thanks */
.frame-flags {
    font-size: 20px;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 4px;
}
.frame-contact {
    text-align: center;
    font-family: "Fira Code", monospace;
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 6px;
}
.frame-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}
.thanks-text {
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-deep);
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
}
.back-to-top:hover { background: var(--accent-hover); }
.back-to-top.visible { display: flex; }

/* Copy feedback */
.copy-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: var(--bg-deep);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 200;
    pointer-events: none;
}
.copy-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 700px) {
    .what-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; gap: 12px; }
    .actions { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}
