/* InforXnews - Premium Design System v4 */

/* ═══ DESIGN TOKENS ═══ */
:root {
    --bg-main: #f4f5f7;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-primary: #8b0000;
    --accent-hover: #a50000;
    --accent-glow: rgba(139, 0, 0, 0.12);
    --accent-secondary: #0f172a;
    --border-color: #e2e8f0;
    --header-bg: rgba(255, 255, 255, 0.82);
    --selection-bg: rgba(139, 0, 0, 0.08);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-hero: 0 12px 40px rgba(0,0,0,0.1);
    --radius-card: 16px;
    --radius-badge: 8px;
    --ticker-bg: #0f172a;
    --gradient-overlay: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
    --gradient-hero: linear-gradient(135deg, rgba(139,0,0,0.06) 0%, transparent 60%);
}

[data-theme="dark"] {
    --bg-main: #09090b;
    --bg-card: #18181b;
    --bg-card-hover: #1e1e22;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --accent-primary: #dc2626;
    --accent-hover: #ef4444;
    --accent-glow: rgba(220, 38, 38, 0.15);
    --accent-secondary: #1e293b;
    --border-color: #27272a;
    --header-bg: rgba(9, 9, 11, 0.85);
    --selection-bg: rgba(220, 38, 38, 0.15);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2);
    --shadow-hero: 0 16px 50px rgba(0,0,0,0.4);
    --ticker-bg: #000000;
    --gradient-overlay: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 100%);
    --gradient-hero: linear-gradient(135deg, rgba(220,38,38,0.05) 0%, transparent 60%);
}

/* ═══ FONTS ═══ */
.font-inter { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
.font-outfit { font-family: 'Outfit', sans-serif; }

/* ═══ BASE ═══ */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.3s ease;
}

::selection {
    background-color: var(--selection-bg);
}

h1, h2, h3, .font-outfit {
    letter-spacing: -0.03em;
}

/* ═══ MARQUEE / TICKER ═══ */
@layer utilities {
    .animate-marquee {
        animation: marquee 35s linear infinite;
    }
    .animate-marquee:hover {
        animation-play-state: paused;
    }
    @keyframes marquee {
        0% { transform: translateX(100%); }
        100% { transform: translateX(-100%); }
    }
    .animate-fade-in {
        animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(12px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* ═══ GEOMETRIC BACKGROUND ═══ */
.geometric-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.geometric-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        linear-gradient(45deg, var(--border-color) 25%, transparent 25%),
        linear-gradient(-45deg, var(--border-color) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--border-color) 75%),
        linear-gradient(-45deg, transparent 75%, var(--border-color) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0;
    opacity: 0.08;
}

[data-theme="dark"] .geometric-bg::before {
    opacity: 0.03;
}

/* ═══ LINE CLAMPS ═══ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══ NEWS CARDS ═══ */
.news-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}
.news-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: var(--gradient-hero);
    pointer-events: none;
    z-index: 1;
}
.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent-primary);
}
.news-card:hover::before {
    opacity: 1;
}
.news-card img {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.news-card:hover img {
    transform: scale(1.08);
}

/* ═══ HERO CARD ═══ */
.hero-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    transition: all 0.45s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}
.hero-card:hover {
    box-shadow: var(--shadow-hero);
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}
.hero-card img {
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}
.hero-card:hover img {
    transform: scale(1.05);
}

/* ═══ CATEGORY BADGE ═══ */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 5px 12px;
    border-radius: var(--radius-badge);
    line-height: 1;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.25);
}

[data-theme="dark"] .category-badge {
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* ═══ ARTICLE PAGE STYLES ═══ */
.article-body {
    font-size: 1.125rem;
    line-height: 1.95;
    color: var(--text-primary);
    max-width: 680px;
}
.article-body p {
    margin-bottom: 1.5rem;
}
.article-body h2, .article-body h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.article-body h2 { font-size: 1.75rem; }
.article-body h3 { font-size: 1.375rem; }
.article-body blockquote {
    border-left: 4px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--accent-glow);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-secondary);
}
.article-body img {
    border-radius: 12px;
    margin: 2rem 0;
}
.article-body a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-body ul, .article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}
.article-body li {
    margin-bottom: 0.5rem;
}

/* ═══ AUTHOR BAR ═══ */
.author-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
}
.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--accent-primary) 0%, #4a0000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

/* ═══ RELATED POST CARD ═══ */
.related-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
}
.related-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateX(4px);
}
.related-card img {
    width: 80px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ═══ COMMENT CARD ═══ */
.comment-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: border-color 0.3s ease;
}
.comment-card:hover {
    border-color: var(--accent-glow);
}

/* ═══ SHARE BUTTON ═══ */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}
.share-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ═══ KEYWORD TAG ═══ */
.keyword-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}
.keyword-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

/* ═══ READING PROGRESS BAR ═══ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), #ff4444);
    z-index: 9999;
    transition: width 0.15s ease-out;
    border-radius: 0 2px 2px 0;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ═══ SKELETON ═══ */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: var(--border-color);
    border-radius: 0.5rem;
}
.skeleton::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.15) 20%, rgba(255,255,255,0.4) 60%, rgba(255,255,255,0));
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* ═══ LIVE INDICATOR PULSE ═══ */
.live-dot {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ═══ IMAGE OVERLAY GRADIENT ═══ */
.img-overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-overlay);
    pointer-events: none;
    z-index: 1;
}

/* ═══ SMOOTH LINK UNDERLINES ═══ */
.nav-link {
    position: relative;
    color: var(--text-secondary);
    font-weight: 700;
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}
.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary);
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .article-body {
        font-size: 1rem;
        line-height: 1.85;
    }
}
