/* ============================================================
   Idiripela Gossip — Stylesheet
   Colors: Hot Pink #C2185B | Dark #1A0814 | Blush #FFF0F5
   ============================================================ */

:root {
    --primary:      #C2185B;
    --primary-dark: #880E4F;
    --primary-light:#E91E8C;
    --accent:       #FF6D00;
    --gold:         #FFCA28;
    --bg-dark:      #1A0814;
    --bg-light:     #FFF0F5;
    --text-dark:    #1A0814;
    --text-muted:   #8B6070;
    --white:        #ffffff;
    --border:       #F8D7E8;
    --font-main:    'Inter', sans-serif;
    --font-si:      'Noto Sans Sinhala', sans-serif;
}

/* Base */
* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    background: var(--bg-light);
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
}

body.lang-si,
body.lang-si p,
body.lang-si h1,
body.lang-si h2,
body.lang-si h3,
body.lang-si h4,
body.lang-si h5,
body.lang-si h6,
body.lang-si .nav-link,
body.lang-si .btn,
body.lang-si .card-title,
body.lang-si .card-text {
    font-family: var(--font-si);
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 3px;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.topbar {
    background: var(--bg-dark);
    color: #e8c0d0;
    padding: 6px 0;
    font-size: .82rem;
}
.topbar a { color: #e8c0d0; }
.topbar a:hover { color: var(--gold); }

.lang-switch-btn {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .8rem;
    transition: background .2s;
}
.lang-switch-btn:hover { background: var(--primary); color: var(--white) !important; }

/* ── Navbar ────────────────────────────────────────────────── */
#mainNav {
    background: var(--white);
    box-shadow: 0 2px 12px rgba(194,24,91,.12);
    padding: 0;
    border-bottom: 3px solid var(--primary);
}

.navbar-brand img { height: 46px; }
.brand-text {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -.3px;
}
.brand-sub {
    font-size: .7rem;
    color: var(--text-muted);
    line-height: 1;
    font-style: italic;
}

.navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 600;
    padding: 1.1rem .75rem;
    position: relative;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: .75rem; right: .75rem;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform .2s;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { transform: scaleX(1); }
.navbar-nav .nav-link.active { color: var(--primary); }

#mainNav.scrolled { box-shadow: 0 4px 20px rgba(194,24,91,.2); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    font-weight: 700;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }

.btn-pink {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    font-weight: 700;
}
.btn-pink:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }

/* ── HOT Ticker ────────────────────────────────────────────── */
.breaking-ticker {
    background: var(--bg-dark);
    color: var(--white);
    padding: 8px 0;
    overflow: hidden;
    font-size: .88rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
}
.breaking-label {
    background: var(--primary);
    padding: 3px 14px;
    border-radius: 3px;
    white-space: nowrap;
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-right: 14px;
    font-weight: 800;
}
.ticker-wrap { overflow: hidden; flex: 1; }
.ticker-items {
    display: flex;
    gap: 60px;
    animation: ticker 15s linear infinite;
    white-space: nowrap;
}
.ticker-items a { color: #ffd0e8; text-decoration: none; }
.ticker-items a:hover { color: var(--gold); text-decoration: underline; }
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Featured Hero ─────────────────────────────────────────── */
.featured-hero {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-dark);
}
.featured-hero img {
    width: 100%;
    height: 460px;
    object-fit: cover;
    opacity: .65;
    display: block;
    transition: opacity .3s, transform .4s;
}
.featured-hero:hover img { opacity: .55; transform: scale(1.02); }
.featured-hero .hero-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(26,8,20,.92));
    padding: 48px 28px 28px;
    color: var(--white);
}
.featured-hero .hero-overlay h2 {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.25;
    font-style: italic;
}
.featured-hero .hero-overlay h2 a { color: var(--white); }
.featured-hero .hero-overlay h2 a:hover { color: var(--gold); }

/* ── Gossip Cards ──────────────────────────────────────────── */
.news-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(194,24,91,.08);
    transition: transform .2s, box-shadow .2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 3px solid var(--primary);
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(194,24,91,.18);
}
.news-card .card-img-top {
    height: 210px;
    object-fit: cover;
    width: 100%;
    transition: transform .35s;
}
.news-card:hover .card-img-top { transform: scale(1.04); }
.news-card .card-img-wrap { overflow: hidden; }
.news-card .card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-card .card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    font-style: italic;
}
.news-card .card-title a { color: inherit; }
.news-card .card-title a:hover { color: var(--primary); }
.news-card .card-text {
    font-size: .88rem;
    color: var(--text-muted);
    flex: 1;
}
.news-card .card-footer-meta {
    font-size: .78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}

/* ── Compact List Card ─────────────────────────────────────── */
.list-news-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.list-news-item:last-child { border-bottom: none; }
.list-news-item img {
    width: 80px; height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.list-news-item .item-body { flex: 1; }
.list-news-item .item-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 4px;
    font-style: italic;
}
.list-news-item .item-title a { color: inherit; }
.list-news-item .item-title a:hover { color: var(--primary); }
.list-news-item .item-meta { font-size: .75rem; color: var(--text-muted); }

/* ── Badges ────────────────────────────────────────────────── */
.badge-cat {
    background: var(--primary);
    color: var(--white);
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-breaking {
    background: var(--accent);
    color: var(--white);
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: 800;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.badge-press {
    background: var(--primary-dark);
    color: var(--white);
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Language badges */
.lang-badge {
    display: inline-block;
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--primary);
    color: #fff;
    vertical-align: middle;
    margin-left: 5px;
    letter-spacing: .4px;
    white-space: nowrap;
}
.lang-badge-only    { background: var(--primary); }
.lang-badge-primary { background: #9b59b6; font-weight: 500; }
.translate-notice {
    background: #fff0f5;
    border: 1px solid var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    padding: .9rem 1.1rem;
    font-size: .88rem;
    color: #555;
}

/* ── Section Titles ────────────────────────────────────────── */
.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    margin-bottom: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Single Article Page ───────────────────────────────────── */
.article-meta {
    font-size: .85rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 12px 0;
}
.article-featured-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 28px;
}
.article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-dark);
}
.article-content p { margin-bottom: 1.2rem; }
.article-content h2, .article-content h3 {
    color: var(--primary-dark);
    margin: 2rem 0 1rem;
    font-style: italic;
}

.share-bar {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 28px 0;
}
.share-bar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--white);
    margin-right: 8px;
    transition: opacity .2s;
}
.share-bar a:hover { opacity: .85; color: var(--white); }
.share-fb { background: #1877F2; }
.share-x  { background: #000; }
.share-wa { background: #25D366; }
.share-li { background: #0A66C2; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar-widget {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(194,24,91,.07);
    margin-bottom: 24px;
    border-top: 3px solid var(--primary);
}
.sidebar-widget-title {
    font-size: .95rem;
    font-weight: 800;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Category Cards ────────────────────────────────────────── */
.cat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(194,24,91,.08);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    border-top: 3px solid var(--primary);
}
.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(194,24,91,.18);
    color: var(--primary-dark);
}
.cat-card .cat-icon { font-size: 2.2rem; color: var(--primary); margin-bottom: 12px; }
.cat-card h5 { font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.cat-card .cat-count { font-size: .85rem; color: var(--text-muted); }

/* ── Admin Sidebar ─────────────────────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: var(--white);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar .sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    background: var(--primary-dark);
}
.admin-sidebar .sidebar-brand .brand-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--white);
    line-height: 1.2;
}
.admin-sidebar .sidebar-brand .brand-sub {
    font-size: .72rem;
    color: rgba(255,255,255,.55);
    font-style: italic;
}
.admin-sidebar .sidebar-brand img { height: 38px; }
.sidebar-nav { padding: 12px 0; }
.sidebar-nav .nav-label {
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    padding: 14px 20px 6px;
}
.sidebar-nav .nav-link {
    color: rgba(255,255,255,.72);
    padding: 10px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    transition: background .15s, color .15s;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(194,24,91,.25);
    color: var(--white);
}
.sidebar-nav .nav-link.active { border-left: 3px solid var(--primary-light); }
.sidebar-nav .nav-link i { width: 18px; text-align: center; }

.admin-content { flex: 1; background: #fdf0f5; padding: 28px; overflow-y: auto; }
.admin-topbar {
    background: var(--white);
    padding: 12px 28px;
    border-bottom: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -28px -28px 28px;
}
.admin-topbar h5 { margin: 0; font-weight: 700; color: var(--primary-dark); }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(194,24,91,.07);
    border-left: 4px solid var(--primary);
}
.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.stat-card .stat-label { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 60%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.login-box {
    background: var(--white);
    border-radius: 14px;
    padding: 44px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-box .login-logo { text-align: center; margin-bottom: 16px; }
.login-box .login-logo img { height: 60px; }
.login-box h3 { text-align: center; color: var(--primary); font-weight: 800; margin-bottom: 6px; }
.login-box .site-sub { text-align: center; color: var(--text-muted); font-size: .88rem; margin-bottom: 28px; font-style: italic; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,.7);
    padding: 52px 0 0;
    margin-top: 60px;
    border-top: 4px solid var(--primary);
}
.footer-brand { font-weight: 800; font-size: 1rem; color: var(--primary-light); line-height: 1.2; }
.footer-tagline { font-size: .72rem; color: rgba(255,255,255,.45); font-style: italic; }
.footer-heading { color: var(--primary-light); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .88rem; }
.footer-links a:hover { color: var(--gold); }
.footer-divider { border-color: rgba(255,255,255,.1); margin: 32px 0 20px; }
.site-footer .text-muted { color: rgba(255,255,255,.4) !important; }
.site-footer small { padding-bottom: 20px; display: inline-block; }

.social-links { display: flex; gap: 10px; }
.social-links a {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.7);
    transition: background .2s, color .2s;
    font-size: .9rem;
}
.social-links a:hover { background: var(--primary); color: var(--white); }

/* ── Pagination ────────────────────────────────────────────── */
.page-link { color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-link:hover { color: var(--primary-dark); }

/* ── Alerts ────────────────────────────────────────────────── */
.alert { border-radius: 8px; }

/* ── Responsive ────────────────────────────────────────────── */

/* Tablet (≤992px) */
@media (max-width: 991.98px) {
    .admin-sidebar { width: 100%; height: auto; position: relative; }
    .admin-wrapper { flex-direction: column; }
    .admin-content { padding: 20px; }
    .admin-topbar { margin: -20px -20px 20px; padding: 12px 20px; }

    .navbar-collapse { border-top: 1px solid var(--border); padding: .5rem 0; }
    .navbar-nav .nav-link { padding: .75rem 1rem; }
    .navbar-nav .nav-link::after { display: none; }
    .navbar-nav .nav-link.active { background: var(--bg-light); border-radius: 6px; color: var(--primary); }

    .navbar-nav .input-group { width: calc(100% - 2rem); margin: .5rem 1rem; }

    .featured-hero img { height: 300px; }
    .featured-hero .hero-overlay { padding: 28px 20px 20px; }
    .featured-hero .hero-overlay h2 { font-size: 1.25rem; }
}

/* Mobile (≤768px) */
@media (max-width: 767.98px) {
    .topbar .container { flex-wrap: nowrap; gap: .25rem; }
    .topbar small { font-size: 0; }
    .topbar small a i { font-size: .8rem; }
    .topbar .d-flex.gap-3 { gap: .4rem !important; }
    .lang-switch-btn { padding: 2px 8px; font-size: .75rem; }
    .topbar a { font-size: .8rem; }

    .navbar-brand img { height: 38px; }
    .brand-text { font-size: 1rem; }
    .brand-sub { display: none; }

    .breaking-ticker { padding: 5px 0; font-size: .82rem; }
    .breaking-label { padding: 2px 10px; font-size: .75rem; margin-right: 8px; }

    .featured-hero img { height: 230px; }
    .featured-hero .hero-overlay h2 { font-size: 1.1rem; font-style: italic; }

    .news-card .card-img-top { height: 170px; }
    .news-card .card-body { padding: 14px; }
    .news-card .card-title { font-size: .92rem; }

    article h1 { font-size: clamp(1.4rem, 6vw, 1.9rem); }
    .article-meta { gap: 10px; font-size: .8rem; }
    .article-featured-img { max-height: 280px; }
    .article-content { font-size: 1rem; line-height: 1.85; }

    .share-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .share-bar a { margin-right: 0; flex: 0 0 auto; padding: 6px 12px; font-size: .8rem; }

    .sidebar-widget { padding: 16px; }
    .site-footer { padding: 32px 0 0; margin-top: 40px; }

    .btn, .nav-link, .page-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .page-link { padding: .5rem .85rem; }
    input, button, select, textarea { min-height: 44px; }

    .login-box { padding: 32px 24px; }
}

/* Small phones (≤575px) */
@media (max-width: 575.98px) {
    .topbar { font-size: .75rem; }
    .featured-hero img { height: 190px; }
    .featured-hero .hero-overlay { padding: 16px 14px 14px; }
    .featured-hero .hero-overlay h2 { font-size: .98rem; }

    article h1 { font-size: 1.3rem; }
    .article-content { font-size: .95rem; }
    .share-bar a { flex: 1 1 calc(50% - 4px); text-align: center; }

    .col-lg-3.col-md-4 { flex: 0 0 50%; max-width: 50%; }
    .cat-card { padding: 18px 12px; }
    .cat-card .cat-icon { font-size: 1.8rem; }

    .login-box { padding: 24px 16px; }
    .login-box h3 { font-size: 1.2rem; }

    .list-news-item img { width: 64px; height: 48px; }

    .admin-content { padding: 14px; }
    .admin-topbar { padding: 10px 14px; margin: -14px -14px 14px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 1.5rem; }
}

/* ── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .ticker-wrap { overflow-x: auto; }
    .ticker-items { animation: none; white-space: nowrap; }
}
