/**
 * STYLE.CSS (Retro-Futuristic - Definitive Edition)
 * Responsibility: Global aesthetics, glassmorphism, and interactive inputs.
 */

:root {
    --bg-color: #020617;
    --panel-bg: rgba(30, 41, 49, 0.7);
    --accent: #22d3ee;
    --accent-glow: rgba(34, 211, 238, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --code-bg: rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(34, 211, 238, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 23, 42, 1) 0, transparent 50%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    margin: 0 auto;
    padding: 20px;
    max-width: 900px;
    min-height: 100vh;
}

/* --- THE PANELS --- */
main, header, section {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
    transition: border-color 0.3s ease;
}

/* --- THE INPUT INTERVENTION (Restoring Polish to Inputs) --- */
#filename, #folderSelect {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 10px 15px;
    color: white;
    outline: none;
    font-family: 'Fira Code', monospace;
    transition: all 0.3s ease;
}

#filename:focus, #folderSelect:focus {
    box-shadow: 0 0 15px var(--accent-glow);
    border-color: #fff;
}

#folderSelect {
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: bold;
}

/* --- CONTENT FORMATTING --- */
h1, h2, h3 {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 800;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 4px;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px var(--accent-glow);
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 3rem 0;
}

ul, ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
li { margin-bottom: 0.6rem; }
li::marker { color: var(--accent); font-weight: bold; }

blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(34, 211, 238, 0.05);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-secondary);
    box-shadow: inset 10px 0 20px -10px var(--accent-glow);
}

code {
    font-family: 'Fira Code', monospace;
    background: var(--code-bg);
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.9em;
    border: 1px solid var(--border);
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

pre code { background: none; border: none; padding: 0; color: var(--text-primary); }

/* --- INTERACTIVE --- */
a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

a:hover {
    filter: brightness(1.2);
    text-shadow: 0 0 12px var(--accent);
}

#searchBar {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--accent);
    border-radius: 50px;
    padding: 10px 25px;
    color: white;
    width: 100%;
    max-width: 400px;
    outline: none;
    transition: all 0.3s ease;
}

#searchBar:focus {
    box-shadow: 0 0 20px var(--accent-glow);
    background: rgba(0, 0, 0, 0.6);
}

/* --- BUTTON SETS --- */
.btn-primary, .btn-danger, .btn-secondary, .tool-btn {
    border-radius: 50px;
    padding: 8px 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.btn-primary { background: var(--accent); border: none; color: var(--bg-color); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px var(--accent-glow); }

.btn-danger { background: #450a0a; color: #f87171; border: 1px solid #7f1d1d; }
.btn-danger:hover { background: #7f1d1d; color: white; }

.btn-secondary, .tool-btn { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-secondary:hover, .tool-btn:hover { background: var(--accent); color: var(--bg-color); }

/* --- PREMIUM EDITOR OVERRIDES --- */
.editor-page #editor-ui {
    display: grid;
    grid-template-rows: auto 1fr;
    height: calc(100vh - 120px);
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.editor-page .meta-panel {
    background: rgba(0,0,0,0.2);
    border-radius: 24px 24px 0 0;
    padding: 1.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}

.editor-page .content-panel {
    border-radius: 0 0 24px 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#content-area {
    width: 100%;
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 2rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.8;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
}

#yaml-area {
    height: 80px;
    font-size: 0.8rem;
    background: #000;
    border-left: 3px solid var(--accent);
    margin-top: 10px;
}

.mobile-tools {
    display: flex;
    background: rgba(0,0,0,0.4);
    padding: 10px;
    gap: 10px;
    border-top: 1px solid var(--border);
    overflow-x: auto;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* --- THE WEAVER POWER RIBBON --- */
.weaver-ribbon {
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 15px;
    gap: 10px;
}

.ribbon-tools-master {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.ribbon-group {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border);
    gap: 4px;
}

.ribbon-group button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    min-width: 32px;
}

.ribbon-group button:hover {
    background: var(--accent);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.prose-stats {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    opacity: 0.8;
}

/* Suggestion Overlay for Wiki-links */
#wiki-suggestions {
    position: absolute;
    background: var(--bg-color);
    border: 1px solid var(--accent);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.suggestion-item:hover {
    background: var(--accent);
    color: var(--bg-color);
}