/* D5News - Shared Design System Styles */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}
.dark ::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.4);
}

/* Sidebar responsive */
#sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 1023px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 60;
        transform: translateX(-100%);
    }
    #sidebar.sidebar-open {
        transform: translateX(0);
    }
}
#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 55;
    backdrop-filter: blur(2px);
}
#sidebarOverlay.active {
    display: block;
}

/* Navigation link states */
.nav-active {
    background: rgba(15, 88, 189, 0.1) !important;
    color: #0f58bd !important;
    font-weight: 700 !important;
}
.dark .nav-active {
    background: rgba(15, 88, 189, 0.2) !important;
}
.nav-inactive {
    color: rgb(100, 116, 139) !important;
}
.nav-inactive:hover {
    background: rgba(241, 245, 249, 1) !important;
}
.dark .nav-inactive {
    color: rgb(148, 163, 184) !important;
}
.dark .nav-inactive:hover {
    background: rgba(30, 41, 59, 1) !important;
}

/* Material Symbols config */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.fill-icon {
    font-variation-settings: 'FILL' 1;
}

/* Smooth transitions */
* {
    scroll-behavior: smooth;
}

/* Table row hover */
.table-row-hover:hover .row-actions {
    opacity: 1 !important;
}

/* Pulse animation for live indicators */
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.animate-pulse-live {
    animation: pulse-live 2s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-track {
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 9999px;
    transition: background 0.2s;
    position: relative;
}
.dark .toggle-track {
    background: #334155;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 9999px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-track {
    background: #0f58bd;
}
.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(20px);
}

/* Article content styling */
.article-content p {
    margin-bottom: 1.5rem;
    line-height: 1.85;
    font-size: 1.0625rem;
}
.article-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #0f58bd;
}

/* Print styles */
@media print {
    #sidebar, header, footer, .no-print { display: none !important; }
    main { margin: 0 !important; padding: 1rem !important; }
}

/* ========================================
   Styles from home.html
   ======================================== */

/* Ticker scroll animation */
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.ticker-animate { animation: ticker-scroll 40s linear infinite; }

/* Hero gradient */
.hero-gradient { background: linear-gradient(135deg, #0f58bd20 0%, #101822 60%); }

/* Sub-navigation scrollbar hiding */
.subnav-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.subnav-scroll::-webkit-scrollbar { display: none; }

/* Live border pulse animation */
@keyframes pulse-live-border {
    0%, 100% { border-color: rgba(239,68,68,0.3); }
    50% { border-color: rgba(239,68,68,0.7); }
}
.live-border-pulse { animation: pulse-live-border 2s ease-in-out infinite; }

/* Equalizer bar animation */
@keyframes eq-bar {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}
.eq-bar { animation: eq-bar 0.8s ease-in-out infinite; }
.eq-bar:nth-child(2) { animation-delay: 0.15s; }
.eq-bar:nth-child(3) { animation-delay: 0.3s; }
.eq-bar:nth-child(4) { animation-delay: 0.1s; }

/* ========================================
   Styles from live.html
   ======================================== */

/* Audio wave animation */
.audio-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 30px;
}
.wave-bar {
    width: 3px;
    background: #0f58bd;
    border-radius: 1px;
    animation: waveAnim 1.2s ease-in-out infinite;
}
.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; }
.wave-bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes waveAnim {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* News ticker scroll animation (live) */
@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.animate-scroll {
    animation: scroll 30s linear infinite;
}

/* Custom scrollbar for chat */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #0f58bd;
}

/* ========================================
   Styles from podcast.html
   ======================================== */

/* Filled icon variant */
.filled-icon { font-variation-settings: 'FILL' 1; }

/* Wave equalizer animation */
.wave-eq { display: flex; align-items: flex-end; gap: 2px; height: 20px; }
.wave-eq span { width: 3px; background: #0f58bd; border-radius: 1px; animation: eqBounce 0.8s ease-in-out infinite alternate; }
.wave-eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.wave-eq span:nth-child(2) { height: 80%; animation-delay: 0.15s; }
.wave-eq span:nth-child(3) { height: 50%; animation-delay: 0.3s; }
.wave-eq span:nth-child(4) { height: 90%; animation-delay: 0.1s; }
.wave-eq span:nth-child(5) { height: 60%; animation-delay: 0.25s; }
@keyframes eqBounce {
    0% { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

/* ========================================
   Homepage Carousel & Category Sections
   ======================================== */

/* Category carousel */
.carousel-track {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Cookie popup animation */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.cookie-popup-animate {
    animation: slideUp 0.4s ease-out forwards;
}

/* Cookie popup overlay fade */
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}
.cookie-overlay-animate {
    animation: fadeInOverlay 0.3s ease-out forwards;
}
