/* ============================================
   SATYA SUTRA — Warm Premium News Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Serif+Devanagari:wght@700;900&family=Source+Serif+4:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
    --bg: #faf8f5;
    --bg-alt: #f3f0eb;
    --bg-card: #ffffff;
    --bg-card-hover: #fefdfb;
    --bg-elevated: #eee9e2;
    --text: #1c1917;
    --text-secondary: #44403c;
    --text-muted: #78716c;
    --accent: #b91c1c;
    --accent-hover: #991b1b;
    --accent-light: #fef2f2;
    --accent-badge: #dc2626;
    --saffron: #ea580c;
    --saffron-light: #fff7ed;
    --border: #e7e5e4;
    --border-hover: #d6d3d1;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-brand: 'Noto Serif Devanagari', serif;
    --shadow-xs: 0 1px 2px rgba(28,25,23,0.05);
    --shadow-sm: 0 1px 3px rgba(28,25,23,0.08), 0 1px 2px rgba(28,25,23,0.04);
    --shadow-md: 0 4px 14px rgba(28,25,23,0.1);
    --shadow-lg: 0 8px 30px rgba(28,25,23,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================
   TICKER BAR
   ============================================ */
.ticker-bar {
    background: var(--text);
    padding: 0.45rem 0;
    overflow: hidden;
}
.ticker-content {
    display: flex;
    animation: ticker-scroll 35s linear infinite;
    white-space: nowrap;
    gap: 3rem;
}
.ticker-item {
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.ticker-item::before { content: '●'; margin-right: 0.5rem; color: var(--accent-badge); font-size: 0.5rem; vertical-align: middle; }
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    padding: 0 2rem;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.brand {
    font-family: var(--font-brand);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.01em;
}
.brand::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--saffron);
    border-radius: 1px;
    margin-top: 1px;
}
.nav-links { display: flex; align-items: center; gap: 0.15rem; }
.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-admin-badge {
    background: var(--accent) !important;
    color: #fff !important;
    font-size: 0.68rem !important;
    padding: 0.35rem 0.7rem !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
}
.nav-logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.nav-logout-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}
.section-label::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}
.section-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 550px;
}

/* ============================================
   STATS ROW
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-xs);
}
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); transform: translateY(-1px); }
.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.25rem;
}
.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ============================================
   FEATURED POST
   ============================================ */
.featured-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.2s;
    display: block;
    box-shadow: var(--shadow-sm);
}
.featured-post:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
    border-left-color: var(--accent);
}
.featured-label {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: var(--accent-light);
    border-radius: 20px;
}
.featured-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.featured-excerpt {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.featured-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   NEWS CARDS
   ============================================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
}
.news-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
    transform: translateY(-3px);
}
.news-card-badge {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--saffron);
    background: var(--saffron-light);
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
    margin-bottom: 0.6rem;
}
.news-card-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}
.news-card-time { display: flex; align-items: center; gap: 0.3rem; }
.news-card-readmore {
    color: var(--accent);
    font-weight: 600;
    transition: gap 0.2s;
    display: flex; align-items: center; gap: 0.2rem;
}
.news-card:hover .news-card-readmore { gap: 0.5rem; }

/* ============================================
   RANKINGS
   ============================================ */
.rankings-list { display: flex; flex-direction: column; gap: 0.75rem; }
.rank-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    transition: all 0.2s;
}
.rank-item:hover { box-shadow: var(--shadow-sm); transform: translateX(4px); }
.rank-item::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; border-radius: 0 2px 2px 0;
    background: var(--text-muted);
}
.rank-item { position: relative; overflow: hidden; }
.rank-item.rank-1::before { background: #f59e0b; }
.rank-item.rank-2::before { background: #94a3b8; }
.rank-item.rank-3::before { background: #d97706; }
.rank-position {
    font-size: 1.5rem; font-weight: 900;
    color: var(--text-muted);
    min-width: 45px; text-align: center;
    font-family: var(--font-serif);
}
.rank-item.rank-1 .rank-position { color: #f59e0b; }
.rank-item.rank-2 .rank-position { color: #94a3b8; }
.rank-item.rank-3 .rank-position { color: #d97706; }
.rank-info { flex: 1; }
.rank-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.1rem; }
.rank-desc { font-size: 0.82rem; color: var(--text-secondary); }
.rank-count { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.rank-count-number { font-size: 1.5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.rank-count-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.rank-bar-container { width: 140px; height: 5px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; }
.rank-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--saffron)); border-radius: 3px; transition: width 0.6s ease; }

/* ============================================
   POST DETAIL
   ============================================ */
.post-detail { max-width: 760px; margin: 0 auto; }
.post-detail-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.post-detail-title {
    font-family: var(--font-serif);
    font-size: 2.2rem; font-weight: 800;
    line-height: 1.2; color: var(--text);
    margin: 0.75rem 0; letter-spacing: -0.02em;
}
.post-detail-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-muted); }
.post-detail-image { margin-bottom: 1.5rem; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.post-detail-image img { width: 100%; max-height: 480px; object-fit: cover; }
.post-detail-content { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.85; color: var(--text-secondary); margin-bottom: 2rem; }
.post-detail-footer { padding-top: 1.25rem; border-top: 1px solid var(--border); margin-top: 1.5rem; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state-title { font-size: 1.15rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.empty-state-text { font-size: 0.9rem; color: var(--text-muted); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.4rem; padding: 0.65rem 1.3rem;
    font-family: inherit; font-size: 0.82rem; font-weight: 600;
    border-radius: var(--radius-sm); border: none; cursor: pointer;
    transition: all 0.15s; text-decoration: none;
}
.btn-primary {
    background: var(--accent); color: #fff;
    box-shadow: var(--shadow-xs);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-sm); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.72rem; }
.btn-danger-outline { background: transparent; border: 1px solid #fecaca; color: var(--accent); }
.btn-danger-outline:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.82rem; color: var(--text-secondary); }
.form-control {
    width: 100%; padding: 0.65rem 0.9rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: inherit; font-size: 0.9rem; transition: all 0.15s;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23868e96' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.2rem;
}
textarea.form-control { resize: vertical; min-height: 90px; }

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 0.85rem 1.1rem; border-radius: var(--radius-sm);
    margin-bottom: 1.25rem; font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; gap: 0.4rem;
    animation: alert-in 0.25s ease;
}
@keyframes alert-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ============================================
   ADMIN PANELS
   ============================================ */
.admin-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 1.25rem; margin-bottom: 2.5rem; }
.panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.panel-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.4rem;
    background: var(--bg-alt);
}
.panel-header-title { font-size: 0.82rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em; }
.panel-body { padding: 1.25rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 0.75rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.admin-table th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.06em; background: var(--bg-alt); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-alt); }

/* ============================================
   LOGIN
   ============================================ */
.login-wrapper { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg-alt); }
.login-card {
    width: 100%; max-width: 400px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 2.5rem;
    box-shadow: var(--shadow-md);
}
.login-card::before { content: ''; display: block; height: 3px; background: linear-gradient(90deg, var(--accent), var(--saffron)); margin: -2.5rem -2.5rem 2rem; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.login-title { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 0.4rem; color: var(--text); }
.login-subtitle { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.login-icon { text-align: center; font-size: 2rem; margin-bottom: 1.25rem; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
    background: var(--bg-alt);
}
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-brand { font-family: var(--font-brand); font-size: 1.15rem; font-weight: 900; color: var(--text); margin-bottom: 0.3rem; }
.footer-text { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .nav-container { flex-direction: column; height: auto; padding: 0.75rem 0; gap: 0.5rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .section-title { font-size: 1.7rem; }
    .news-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .featured-title { font-size: 1.4rem; }
    .featured-post { grid-template-columns: 1fr !important; }
    .rank-bar-container { display: none; }
    .container { padding: 1.25rem 1rem; }
    .post-detail-title { font-size: 1.6rem; }
    .post-detail-content { font-size: 0.95rem; }
    .ticker-bar { display: none; }
}
