/* WoW Profiles – Dark modern UI – full width */
:root {
    --bg: #0c0e12;
    --bg-card: #151922;
    --bg-hover: #1e2430;
    --accent: #4f8cff;
    --accent-bright: #6ba3ff;
    --accent-dim: #3a6fd8;
    --text: #e8ecf4;
    --text-muted: #9aa3b5;
    --border: #2a3140;
    --success: #27ae60;
    --danger: #c0392b;
    --radius: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent-bright); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

/* ========== HEADER ========== */
.site-header {
    background: linear-gradient(180deg, #12151c 0%, #0c0e12 100%);
    border-bottom: 2px solid var(--accent-dim);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}
.header-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.logo {
    display: flex;
    flex-direction: column;
    color: var(--text);
}
.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-bright);
    letter-spacing: 0.02em;
}
.tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
}
.main-nav a:hover,
.main-nav a.active {
    background: var(--bg-hover);
    color: var(--accent-bright);
}
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 1.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    cursor: pointer;
}

/* ========== SITE BANNER ========== */
.site-banner {
    width: 100%;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-weight: 500;
    border-bottom: 1px solid transparent;
}
.site-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
}
.site-banner-inner p { margin: 0; }
.site-banner-inner a { text-decoration: underline; }
.site-banner-warning {
    background: #3a2a12;
    color: #f5c878;
    border-bottom-color: #3a6fd8;
}
.site-banner-danger {
    background: #3a1a1a;
    color: #f0a0a0;
    border-bottom-color: #c0392b;
}
.site-banner-info {
    background: #1a2a3a;
    color: #85c1e9;
    border-bottom-color: #3498db;
}
.site-banner-success {
    background: #1a3a28;
    color: #7dcea0;
    border-bottom-color: #27ae60;
}

/* ========== MAIN ========== */
.site-main {
    flex: 1;
    width: 100%;
    max-width: 100%;
    padding: 1.5rem;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    font-size: 1.8rem;
    color: var(--accent-bright);
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Cards / panels */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}
.card h2, .card h3 {
    color: var(--accent);
    margin-bottom: 0.75rem;
}

/* News list */
.news-list { display: flex; flex-direction: column; gap: 1.5rem; }
.news-item {
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.25rem 1.5rem;
}
.news-item h2 { margin-bottom: 0.4rem; font-size: 1.35rem; }
.news-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.news-content { line-height: 1.7; }
.news-content img { margin: 0.75rem 0; border-radius: var(--radius); max-height: 400px; }

/* Characters table */
.table-wrap { overflow-x: auto; width: 100%; }
table.chars-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}
.chars-table th,
.chars-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.chars-table th {
    background: #241e18;
    color: var(--accent-bright);
    font-weight: 600;
    white-space: nowrap;
}
.chars-table tr:hover td { background: var(--bg-hover); }
.chars-table .photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border);
}
.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    background: var(--accent);
    color: #0c0e12 !important;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn:hover { background: var(--accent-bright); transform: translateY(-1px); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent) !important;
}
.btn-outline:hover { background: var(--accent); color: #0c0e12 !important; }
.btn-danger { background: var(--danger); color: #fff !important; }
.btn-danger:hover { background: #e74c3c; }

/* Character full profile */
.profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}
.profile-photo {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 3px solid var(--accent-dim);
    box-shadow: var(--shadow);
}
.profile-meta dt { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.6rem; }
.profile-meta dd { font-weight: 500; margin-left: 0; }

/* Galleries */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .15s, border-color .15s;
}
.gallery-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}
.gallery-card .thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #0a0908;
}
.gallery-card .info { padding: 1rem; }
.gallery-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.gallery-card .artist { font-size: 0.85rem; color: var(--text-muted); }

.thumbs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.thumbs-grid a,
.thumbs-grid-item {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color .15s;
    content-visibility: auto;
    contain-intrinsic-size: 140px 160px;
}
.thumbs-grid a:hover,
.thumbs-grid-item:hover { border-color: var(--accent); }
.thumbs-grid img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #12151c;
}
.thumbs-caption {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.35rem 0.25rem 0.4rem;
    text-align: center;
    line-height: 1.3;
}

/* Stories */
.story-list { display: flex; flex-direction: column; gap: 1rem; }
.story-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.story-item h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.warnings {
    display: inline-block;
    background: #3a1f1a;
    color: #e8a090;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-top: 0.4rem;
}
.cw-gate {
    background: #241a14;
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: #0f0d0b;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}
.form-group textarea { min-height: 160px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(230,126,34,0.25);
}

/* Flash */
.flash {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-weight: 500;
}
.flash.success { background: #1a3a28; color: #7dcea0; border: 1px solid #27ae60; }
.flash.error   { background: #3a1f1a; color: #e8a090; border: 1px solid #c0392b; }
.flash.info    { background: #1a2a3a; color: #85c1e9; border: 1px solid #3498db; }

/* Footer */
.site-footer {
    background: #0a0908;
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.admin-link { margin-top: 0.4rem; }

/* ========== ADMIN ========== */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 120px);
    width: 100%;
}
.admin-sidebar {
    width: 220px;
    background: #16120f;
    border-right: 1px solid var(--border);
    padding: 1.25rem 0;
    flex-shrink: 0;
}
.admin-sidebar h3 {
    padding: 0 1rem 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.admin-sidebar a {
    display: block;
    padding: 0.55rem 1.25rem;
    color: var(--text-muted);
    border-left: 3px solid transparent;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--bg-hover);
    color: var(--accent-bright);
    border-left-color: var(--accent);
}
.admin-content {
    flex: 1;
    padding: 1.5rem;
    overflow-x: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.stat-card .num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-bright);
}
.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}
.admin-table th, .admin-table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.admin-table th {
    background: #241e18;
    color: var(--accent-bright);
}
.admin-table .actions { white-space: nowrap; }
.admin-table .actions a, .admin-table .actions button {
    margin-right: 0.4rem;
}

.login-box {
    max-width: 380px;
    margin: 4rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.login-box h1 {
    text-align: center;
    color: var(--accent-bright);
    margin-bottom: 1.5rem;
}

/* Markdown content helpers */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: var(--accent);
    margin: 1.2rem 0 0.6rem;
}
.markdown-body p { margin-bottom: 0.9rem; }
.markdown-body ul, .markdown-body ol { margin: 0.6rem 0 0.9rem 1.5rem; }
.markdown-body blockquote {
    border-left: 3px solid var(--accent-dim);
    padding-left: 1rem;
    color: var(--text-muted);
    margin: 0.8rem 0;
}
.markdown-body code {
    background: #0a0908;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}
.markdown-body pre {
    background: #0a0908;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 0.8rem 0;
}

/* ========== LIGHTBOX ========== */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.lightbox-overlay.open {
    display: flex;
}
.lightbox-content {
    max-width: min(96vw, 1400px);
    max-height: 92vh;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-stage {
    overflow: hidden;
    max-width: 96vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.lightbox-img {
    max-width: 96vw;
    max-height: 75vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}
.lightbox-img.zoomed {
    cursor: grab;
    max-width: none;
    max-height: none;
}
.lightbox-img.zoomed.dragging {
    cursor: grabbing;
    transition: none;
}
.lightbox-caption {
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-size: 0.95rem;
}
.lightbox-counter {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    opacity: 0.8;
}
.lightbox-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.65;
}
.lightbox-toolbar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(28, 24, 20, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.35rem 0.6rem;
    z-index: 10001;
}
.lightbox-toolbar button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent-bright);
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.lightbox-toolbar button:hover {
    background: var(--accent);
    color: #0c0e12;
}
.lightbox-zoom-label {
    color: var(--text);
    font-size: 0.85rem;
    min-width: 3.2rem;
    text-align: center;
}
.lightbox-zoom-reset {
    width: auto !important;
    padding: 0 0.5rem;
    font-size: 0.8rem !important;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(28, 24, 20, 0.85);
    border: 1px solid var(--border);
    color: var(--accent-bright);
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 1.5rem;
    line-height: 1;
    z-index: 10000;
    transition: background 0.15s, color 0.15s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent);
    color: #0c0e12;
}
.lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
}
.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
@media (max-width: 600px) {
    .lightbox-prev { left: 0.35rem; }
    .lightbox-next { right: 0.35rem; }
    .lightbox-close { top: 0.5rem; right: 0.5rem; }
    .lightbox-hint { display: none; }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .main-nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #12151c;
        flex-direction: column;
        padding: 0.5rem;
        border-bottom: 2px solid var(--accent-dim);
    }
    .main-nav.open ul { display: flex; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-photo { margin: 0 auto; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .admin-sidebar a { display: inline-block; border-left: none; border-bottom: 2px solid transparent; }
    .admin-sidebar a.active { border-bottom-color: var(--accent); }
}

/* ========== DROPZONE (admin uploads) ========== */
.dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: #0f0d0b;
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.is-dragover {
    border-color: var(--accent);
    background: #1a1510;
}
.dropzone-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
}
.dropzone-label {
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}
.dropzone-browse {
    color: var(--accent-bright);
    text-decoration: underline;
}
.dropzone-list {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}
.dropzone-files {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    text-align: left;
    max-height: 140px;
    overflow-y: auto;
}
.dropzone-files li {
    padding: 0.25rem 0.4rem;
    border-bottom: 1px solid var(--border);
    word-break: break-all;
}
.dropzone-empty {
    opacity: 0.7;
    font-size: 0.85rem;
}


/* Gallery pagination */
.gallery-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
}
.gallery-pager-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}


/* News polls */
.news-poll {
    background: var(--bg-hover, #12151c);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}
.news-poll-question {
    color: var(--accent);
    font-size: 1.1rem;
    margin: 0 0 1rem;
}
.news-poll-option {
    display: block;
    padding: 0.45rem 0.35rem;
    cursor: pointer;
    border-radius: 4px;
}
.news-poll-option:hover {
    background: rgba(255,140,0,0.08);
}
.news-poll-results {
    list-style: none;
    margin: 0;
    padding: 0;
}
.news-poll-result {
    margin-bottom: 0.85rem;
}
.news-poll-result.is-mine .news-poll-label {
    color: var(--accent-bright);
}
.news-poll-yours {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}
.news-poll-bar-wrap {
    height: 8px;
    background: #0a0908;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.3rem 0;
}
.news-poll-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    min-width: 0;
    transition: width 0.3s ease;
}
.news-poll-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.news-poll-total {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}
.news-item h2 a {
    color: inherit;
    text-decoration: none;
}
.news-item h2 a:hover {
    color: var(--accent-bright);
}
