/* Modern Dark Design System for Petty Vices */
:root {
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-card-hover: #1e293b;
    --border-color: #26334d;
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-secondary: #06b6d4;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header & Navigation */
.header {
    background-color: rgba(21, 28, 44, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
}

.header-brand-img {
    height: 44px;
    width: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Main Grid Layout */
.main-content {
    flex: 1;
    padding: 32px 0;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
}

/* Card Styling */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
    border-color: rgba(99, 102, 241, 0.3);
}

.hero-content h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.stats-pills {
    display: flex;
    gap: 12px;
}

.stat-pill {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-pill strong {
    color: var(--accent-secondary);
}

/* Section Header */
.section-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Story Card */
.story-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.story-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-topic {
    background-color: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
}

.topic-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
}

.topic-card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topic-card-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.badge-topic:hover {
    background-color: rgba(99, 102, 241, 0.35);
}

.badge-comment {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-active {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-archived {
    background-color: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.story-date {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.story-title {
    font-size: 1.4rem;
    line-height: 1.3;
}

.story-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

.story-title a:hover {
    color: var(--accent-primary);
}

.story-summary {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.story-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    margin-top: 4px;
}

.story-author strong {
    color: var(--text-main);
}

.meta-separator {
    color: var(--text-dim);
}

.comments-link {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.comments-link:hover {
    text-decoration: underline;
}

.story-hits {
    color: var(--text-dim);
}

/* Sidebar Widgets */
.widget-card {
    padding: 20px;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.poll-question {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.poll-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.poll-radio-option:hover {
    border-color: var(--accent-primary);
    background-color: rgba(99, 102, 241, 0.08);
}

.poll-result-item {
    margin-bottom: 10px;
}

.poll-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.progress-bar {
    background-color: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.widget-footer-link {
    margin-top: 12px;
    text-align: right;
    font-size: 0.85rem;
}

.widget-footer-link a {
    color: var(--accent-primary);
    text-decoration: none;
}

.topic-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.topic-item:hover {
    color: var(--text-main);
    background-color: rgba(99, 102, 241, 0.1);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.05rem;
}

/* Comments Section */
.comments-section {
    margin-top: 32px;
}

.comment-card {
    border-left: 3px solid var(--accent-primary);
    margin-bottom: 16px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.comment-author {
    color: var(--text-main);
}

.comment-date {
    color: var(--text-dim);
}

.comment-body {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Table Styling */
.table-card {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.analytics-table th, .analytics-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.analytics-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table-story-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

.table-story-link:hover {
    color: var(--accent-primary);
}

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

/* Footer */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text-main);
}

/* Responsive Rules */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 12px;
    }
}