/* V2Bot Stories — Minimal, clean, SEO-friendly */

/* Light theme (default) */
:root {
    --gold: #B8941F;
    --gold-light: #D4AF37;
    --cyan: #0891B2;
    --bg: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-hover: #F4F4F5;
    --text: #18181B;
    --text-muted: #71717A;
    --border: #E4E4E7;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --max-width: 800px;
    --max-width-wide: 1100px;
}

/* Dark theme */
[data-theme="dark"] {
    --gold: #C9A94E;
    --gold-light: #E8D48B;
    --cyan: #22D3EE;
    --bg: #0A0A0B;
    --bg-card: #141416;
    --bg-hover: #1C1C1F;
    --text: #E4E4E7;
    --text-muted: #71717A;
    --border: #27272A;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

.container { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
    backdrop-filter: blur(8px);
}
.header .container { display: flex; justify-content: space-between; align-items: center; }

.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; }
.logo-icon {
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.logo-text { color: var(--text); }

.nav { display: flex; align-items: center; gap: 1.5rem; font-size: 0.9rem; }
.nav a { color: var(--text-muted); }
.nav a:hover { color: var(--text); }

/* Language Switcher Dropdown */
.lang-switcher { position: relative; z-index: 100; }
.lang-switcher__toggle {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.lang-switcher__toggle:hover { border-color: var(--gold); color: var(--text); }
.lang-switcher__globe { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.lang-switcher__code { text-transform: uppercase; font-weight: 500; }
.lang-switcher__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 150px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.lang-switcher--open .lang-switcher__dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.lang-switcher__option {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.lang-switcher__option:hover { background: var(--bg-hover); opacity: 1; }
.lang-switcher__option--active { background: var(--bg-hover); color: var(--gold); font-weight: 500; }
.lang-switcher__flag { font-size: 16px; line-height: 1; }
.lang-switcher--inline .lang-switcher__dropdown { left: 0; right: auto; }
.lang-switcher--inline .lang-switcher__toggle { font-size: 0.82rem; padding: 5px 10px; }

/* Main */
.main { min-height: calc(100vh - 200px); padding: 2rem 0; }

/* Feed */
.feed-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.feed-subtitle { color: var(--text-muted); margin-bottom: 2rem; }

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}
.story-card:hover { border-color: var(--gold); transform: translateY(-2px); }

.story-card-cover {
    width: 100%;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.story-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.story-card-title a { color: var(--text); }

.story-card-summary {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.story-card-author { color: var(--gold); }

.story-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.tag:hover { color: var(--gold); border-color: var(--gold); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1rem 0;
}
.pagination-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.pagination-link:hover { border-color: var(--gold); color: var(--gold); }
.pagination-info { color: var(--text-muted); font-size: 0.9rem; }

/* Story Page */
.story-full { max-width: var(--max-width); margin: 0 auto; }

.story-header { margin-bottom: 2rem; }
.story-title { font-size: 2.2rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.75rem; }
.story-summary { color: var(--text-muted); font-size: 1.1rem; font-style: italic; margin-bottom: 1.5rem; }

.story-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.story-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 500;
}
.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.story-views {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.story-views svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}
.story-read-time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.story-read-time svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.story-tags { margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.story-article-lang { margin-bottom: 1.5rem; }

/* Story Content */
.story-content {
    font-size: 1.05rem;
    line-height: 1.8;
}
.story-content h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; font-weight: 600; }
.story-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; font-weight: 600; }
.story-content p { margin-bottom: 1.25rem; }
.story-content ul, .story-content ol { margin: 0.75rem 0 1.25rem 1.5rem; }
.story-content li { margin-bottom: 0.4rem; }
.story-content blockquote {
    border-left: 3px solid var(--gold);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}
.story-content code {
    font-family: var(--font-mono);
    background: var(--bg-hover);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}
.story-content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}
.story-content pre code { background: none; padding: 0; }
.story-content img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }

/* Story Footer */
/* Draft Preview Banner (Phase 3A) */
.story-draft-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
}
.draft-banner-info { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.draft-banner-status {
    font-weight: 600;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--gold);
    color: #000;
}
.draft-banner-text { font-size: 0.9rem; color: var(--text-muted); }
.draft-banner-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.draft-banner-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.draft-btn-publish { background: var(--gold); color: #000; }
.draft-btn-publish:hover { opacity: 0.85; }
.draft-btn-edit { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.draft-btn-edit:hover { border-color: var(--gold); }
.draft-btn-reject { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.draft-btn-reject:hover { border-color: #ef4444; color: #ef4444; }

@media (max-width: 640px) {
    .story-draft-banner { flex-direction: column; align-items: flex-start; }
    .draft-banner-actions { width: 100%; justify-content: flex-end; }
}

/* Cover Image (Phase 5) */
.story-cover { margin-bottom: 1.5rem; border-radius: 12px; overflow: hidden; }
.story-cover-img { width: 100%; height: auto; display: block; }

/* Edit button (Phase 3B) */
.story-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
}
.story-edit-btn:hover { color: var(--gold); background: rgba(212, 175, 55, 0.1); }
.story-edit-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.story-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }

.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.share-label { color: var(--text-muted); font-size: 0.9rem; margin-right: 0.25rem; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.share-btn svg { flex-shrink: 0; }
.share-telegram:hover { border-color: #26A5E4; color: #26A5E4; background: rgba(38,165,228,0.06); }
.share-vk:hover { border-color: #0077FF; color: #0077FF; background: rgba(0,119,255,0.06); }
.share-ok:hover { border-color: #EE8208; color: #EE8208; background: rgba(238,130,8,0.06); }
.share-whatsapp:hover { border-color: #25D366; color: #25D366; background: rgba(37,211,102,0.06); }
.share-viber:hover { border-color: #7360F2; color: #7360F2; background: rgba(115,96,242,0.06); }
.share-facebook:hover { border-color: #1877F2; color: #1877F2; background: rgba(24,119,242,0.06); }
.share-x:hover { border-color: #536471; color: #536471; background: rgba(83,100,113,0.06); }
.share-linkedin:hover { border-color: #0A66C2; color: #0A66C2; background: rgba(10,102,194,0.06); }
.share-copy { cursor: pointer; background: none; }
.share-copy:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,0.06); }

.story-cta {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}
.story-cta p { margin-bottom: 1rem; color: var(--text-muted); }
.cta-button {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #000;
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.95rem;
}
.cta-button:hover { opacity: 0.9; }

/* Author Profile */
.author-profile {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.author-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--cyan));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.author-name { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.25rem; }
.author-handle { color: var(--gold); margin-bottom: 0.5rem; }
.author-bio { color: var(--text-muted); max-width: 500px; margin: 0 auto 0.5rem; }
.author-stats { color: var(--text-muted); font-size: 0.9rem; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer a { color: var(--gold); }
.footer-social { margin-top: 0.5rem; }
.footer-social a { color: var(--gold); }
.footer-copy { margin-top: 0.5rem; }

/* Theme Switcher */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* User Menu */
.user-menu { position: relative; display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.user-avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--cyan)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }
.user-name { font-size: 0.85rem; color: var(--text); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown { display: none; position: absolute; top: 100%; right: 0; padding-top: 0.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem; min-width: 140px; z-index: 200; box-shadow: 0 4px 12px rgba(0,0,0,0.1); margin-top: 4px; }
.user-menu.open .user-dropdown { display: block; }
.user-dropdown-item { display: block; width: 100%; padding: 0.5rem 0.75rem; text-align: left; background: none; border: none; color: var(--text); font-size: 0.85rem; font-family: var(--font); cursor: pointer; border-radius: 4px; text-decoration: none; }
.user-dropdown-item:hover { background: var(--bg-hover); color: var(--gold); opacity: 1; }
.login-link { padding: 0.35rem 0.75rem; border: 1px solid var(--gold); border-radius: 6px; color: var(--gold); font-size: 0.85rem; font-weight: 500; background: none; cursor: pointer; font-family: var(--font); transition: background 0.2s, color 0.2s; }
.login-link:hover { background: var(--gold); color: #000; }

/* Mobile */
@media (max-width: 640px) {
    .stories-grid { grid-template-columns: 1fr; }
    .story-title { font-size: 1.6rem; }
    .feed-title { font-size: 1.5rem; }
    .story-meta { flex-wrap: wrap; gap: 0.5rem; }
    .nav { gap: 0.75rem; font-size: 0.8rem; }
    .lang-switcher__dropdown { min-width: 130px; }
    .user-name { display: none; }
}
