/* ═══════════════════════════════════════════════════════════════════════════
   HR24.ro — Custom Styles
   Dark-first news platform with neon accents
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ──────────────────────────────────────────────────────── */

:root {
    --hr24-primary: #0EA5E9;
    --hr24-accent: #F59E0B;
    --hr24-dark: #0F172A;
    --hr24-dark-card: #1E293B;
    --hr24-neon-blue: #38BDF8;
    --hr24-text: #F8FAFC;
    --hr24-text-muted: #94A3B8;
    --hr24-success: #22C55E;
    --hr24-error: #EF4444;
    --hr24-warning: #F59E0B;
}

/* ─── Smooth Scroll ──────────────────────────────────────────────────────── */

html {
    scroll-behavior: smooth;
}

/* ─── Custom Scrollbar (Dark Theme) ──────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--hr24-dark);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 var(--hr24-dark);
}

/* ─── Neon Logo Animation ────────────────────────────────────────────────── */

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 7px var(--hr24-neon-blue),
            0 0 10px var(--hr24-neon-blue),
            0 0 21px var(--hr24-neon-blue),
            0 0 42px var(--hr24-primary),
            0 0 82px var(--hr24-primary);
    }
    50% {
        text-shadow:
            0 0 4px var(--hr24-neon-blue),
            0 0 7px var(--hr24-neon-blue),
            0 0 13px var(--hr24-neon-blue),
            0 0 25px var(--hr24-primary);
    }
}

.neon-pulse {
    animation: neonPulse 2.5s ease-in-out infinite;
}

.neon-text {
    color: var(--hr24-neon-blue);
    text-shadow:
        0 0 7px var(--hr24-neon-blue),
        0 0 10px var(--hr24-neon-blue),
        0 0 21px var(--hr24-neon-blue);
}

/* ─── Breaking News Ticker Animation ─────────────────────────────────────── */

@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.ticker-animation {
    animation: ticker 30s linear infinite;
}

.ticker-animation:hover {
    animation-play-state: paused;
}

.ticker-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.ticker-content {
    display: inline-flex;
    white-space: nowrap;
}

/* ─── Reading Progress Bar ───────────────────────────────────────────────── */

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hr24-primary), var(--hr24-accent));
    z-index: 50;
    width: 0%;
    transition: width 0.1s ease-out;
}

#reading-progress.active {
    display: block;
}

/* ─── Card Hover Effects ─────────────────────────────────────────────────── */

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.4),
        0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 60%
    );
    transition: transform 0.5s ease;
    transform: translateX(-100%);
}

.card-shine:hover::after {
    transform: translateX(100%);
}

/* ─── Image Overlays ─────────────────────────────────────────────────────── */

.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, transparent 60%);
    pointer-events: none;
}

.image-overlay img {
    transition: transform 0.5s ease;
}

.image-overlay:hover img {
    transform: scale(1.05);
}

/* ─── Sticky Sidebar ─────────────────────────────────────────────────────── */

.sidebar-sticky {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar-sticky::-webkit-scrollbar {
    width: 4px;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 2px;
}

/* ─── Newsletter Form Styles ─────────────────────────────────────────────── */

.newsletter-input {
    background: var(--hr24-dark);
    border: 1px solid #334155;
    color: var(--hr24-text);
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--hr24-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.newsletter-input::placeholder {
    color: var(--hr24-text-muted);
}

.newsletter-btn {
    background: linear-gradient(135deg, var(--hr24-primary), #0284C7);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

.newsletter-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.newsletter-btn:active {
    transform: translateY(0);
}

.newsletter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ─── Search Modal Overlay ───────────────────────────────────────────────── */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.search-overlay.hidden {
    display: none;
}

.search-overlay input[type="search"],
.search-overlay input[type="text"] {
    background: var(--hr24-dark-card);
    border: 2px solid #334155;
    color: var(--hr24-text);
    font-size: 1.25rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 640px;
    transition: border-color 0.3s ease;
}

.search-overlay input:focus {
    outline: none;
    border-color: var(--hr24-primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.search-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--hr24-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.search-close:hover {
    color: var(--hr24-text);
}

/* ─── Toast Notifications ────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 60;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--hr24-success);
    color: white;
}

.toast-error {
    background: var(--hr24-error);
    color: white;
}

/* ─── Article Content Styling ────────────────────────────────────────────── */

.article-content {
    line-height: 1.8;
    font-size: 1.0625rem;
    color: var(--hr24-text);
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--hr24-text);
    border-left: 4px solid var(--hr24-primary);
    padding-left: 0.75rem;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--hr24-text);
}

.article-content p {
    margin-bottom: 1.25rem;
    color: #CBD5E1;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.article-content a {
    color: var(--hr24-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: var(--hr24-neon-blue);
}

.article-content blockquote {
    border-left: 4px solid var(--hr24-accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #CBD5E1;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: #CBD5E1;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content figure {
    margin: 1.5rem 0;
    text-align: center;
}

.article-content figcaption {
    font-size: 0.875rem;
    color: var(--hr24-text-muted);
    margin-top: 0.5rem;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-content th,
.article-content td {
    padding: 0.75rem;
    border: 1px solid #334155;
    text-align: left;
}

.article-content th {
    background: var(--hr24-dark-card);
    font-weight: 600;
}

.article-content pre {
    background: var(--hr24-dark);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.article-content code {
    background: rgba(30, 41, 59, 0.7);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* ─── Footer Gradient ────────────────────────────────────────────────────── */

.footer-gradient {
    background: linear-gradient(180deg, #020617 0%, #0F172A 50%, #1E293B 100%);
}

/* ─── Category Badge Colors ──────────────────────────────────────────────── */

.badge-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(14, 165, 233, 0.15);
    color: var(--hr24-primary);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-breaking {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.badge-urgent {
    background: rgba(245, 158, 11, 0.15);
    color: var(--hr24-accent);
    border-color: rgba(245, 158, 11, 0.3);
}

/* ─── Skeleton Loading ───────────────────────────────────────────────────── */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--hr24-dark-card) 25%,
        #2D3B4F 50%,
        var(--hr24-dark-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.375rem;
}

/* ─── Fade In Animation ──────────────────────────────────────────────────── */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* ─── Light Mode Override ────────────────────────────────────────────────── */

[data-theme="light"] {
    --hr24-dark: #F8FAFC;
    --hr24-dark-card: #FFFFFF;
    --hr24-text: #0F172A;
    --hr24-text-muted: #64748B;
}

[data-theme="light"] body {
    background-color: #F1F5F9;
    color: #0F172A;
}

[data-theme="light"] header {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .bg-slate-900 {
    background-color: #F8FAFC;
}

[data-theme="light"] .bg-slate-800 {
    background-color: #FFFFFF;
}

[data-theme="light"] .bg-slate-950 {
    background-color: #F1F5F9;
}

[data-theme="light"] .text-slate-100,
[data-theme="light"] .text-white {
    color: #0F172A;
}

[data-theme="light"] .text-slate-300,
[data-theme="light"] .text-slate-400 {
    color: #475569;
}

[data-theme="light"] .text-gray-400 {
    color: #64748B;
}

[data-theme="light"] .border-slate-700,
[data-theme="light"] .border-slate-800 {
    border-color: #E2E8F0;
}

[data-theme="light"] .article-content p {
    color: #334155;
}

[data-theme="light"] .article-content blockquote {
    background: rgba(241, 245, 249, 0.7);
}

[data-theme="light"] .newsletter-input {
    background: #F1F5F9;
    border-color: #CBD5E1;
    color: #0F172A;
}

[data-theme="light"] .footer-gradient {
    background: linear-gradient(180deg, #E2E8F0 0%, #F1F5F9 50%, #F8FAFC 100%);
}

[data-theme="light"] .neon-text {
    color: var(--hr24-primary);
    text-shadow: none;
}

[data-theme="light"] .neon-pulse {
    animation: none;
    text-shadow: none;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #F1F5F9;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #CBD5E1;
}

[data-theme="light"] .skeleton {
    background: linear-gradient(
        90deg,
        #E2E8F0 25%,
        #F1F5F9 50%,
        #E2E8F0 75%
    );
    background-size: 200% 100%;
}

/* ─── Responsive Utilities ───────────────────────────────────────────────── */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-news {
    aspect-ratio: 4 / 3;
}

/* ─── Mobile Navigation ──────────────────────────────────────────────────── */

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
    max-height: 500px;
}

/* ─── Breaking News Dot Separator ────────────────────────────────────────── */

.breaking-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hr24-accent);
    margin: 0 1rem;
    vertical-align: middle;
}

/* ─── Ad Label ───────────────────────────────────────────────────────────── */

.ad-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hr24-text-muted);
    text-align: center;
    margin-top: 0.25rem;
}

/* ─── Views Count Badge ──────────────────────────────────────────────────── */

.views-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--hr24-text-muted);
}

/* ─── Print Styles ───────────────────────────────────────────────────────── */

@media print {
    header,
    footer,
    .sidebar-sticky,
    .ad-label,
    .breaking-ticker,
    #reading-progress,
    #search-modal,
    .newsletter-form,
    nav[aria-label="Paginare"],
    .toast {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .article-content {
        color: black;
    }

    .article-content a {
        color: black;
        text-decoration: underline;
    }

    .article-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .article-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    main {
        max-width: 100% !important;
        padding: 0 !important;
    }
}
