/* ==========================================
   DARK MODE STYLES - News Portal (Frontend Only)
   ========================================== */

/* Prevent Flash of White Background */
html {
    background-color: #ffffff;
}

html[data-theme="dark"] {
    background-color: #0f172a;
}

/* Dark Mode Toggle Button - Available Everywhere */
.dark-mode-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    padding: 3px;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(var(--god-primary-rgb), 0.3);
}

/* Dark mode specific styles for the toggle */
[data-theme="dark"] .dark-mode-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 85, 85, 0.5);
}

.dark-mode-toggle-slider {
    position: absolute;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .dark-mode-toggle-slider {
    transform: translateX(13px);
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.4), 0 0 15px rgba(129, 140, 248, 0.2);
}

.dark-mode-toggle-icon {
    font-size: 12px;
    color: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Notification Badge - Available Everywhere */
.notification-badge {
    position: relative;
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--god-primary);
    color: #ffffff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(var(--god-primary-rgb), 0.5);
    animation: notification-pulse 2s infinite;
}

@keyframes notification-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Fact-Check Labels - Available Everywhere */
.fact-check-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.fact-check-badge i {
    font-size: 0.85rem;
}

.fact-check-verified {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #ffffff;
}

.fact-check-unverified {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #ffffff;
}

.fact-check-false {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #ffffff;
}

.fact-check-misleading {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: #ffffff;
}

.fact-check-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Notification Dropdown - Available Everywhere */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
    z-index: 1000;
    display: none;
}

[data-theme="dark"] .notification-dropdown {
    background: #1e293b;
}

.notification-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .notification-header {
    border-bottom-color: #334155;
}

.notification-header h6 {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
}

[data-theme="dark"] .notification-header h6 {
    color: #f1f5f9;
}

.mark-all-read {
    font-size: 0.8rem;
    color: var(--god-primary);
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.mark-all-read:hover {
    opacity: 0.8;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    gap: 1rem;
}

[data-theme="dark"] .notification-item {
    border-bottom-color: #334155;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

[data-theme="dark"] .notification-item:hover {
    background-color: #1e293b;
}

.notification-item.unread {
    background-color: rgba(255, 62, 62, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--god-primary) 0%, var(--god-primary-light) 100%);
}

.notification-icon i {
    color: #ffffff;
    font-size: 16px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

[data-theme="dark"] .notification-title {
    color: #f1f5f9;
}

.notification-message {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

[data-theme="dark"] .notification-message {
    color: #cbd5e1;
}

.notification-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.notification-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}

.notification-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ==========================================
   FRONTEND DARK MODE STYLES ONLY
   ========================================== */

/* Only apply to frontend (not admin panel) */
body:not(.admin-body) {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body:not(.admin-body)[data-theme="dark"] {
    background-color: #0f172a;
    color: #f1f5f9;
}

/* Cards and Containers - Frontend Only */
body:not(.admin-body)[data-theme="dark"] .card,
body:not(.admin-body)[data-theme="dark"] .popular-card-modern,
body:not(.admin-body)[data-theme="dark"] .social-card-modern,
body:not(.admin-body)[data-theme="dark"] .news-card,
body:not(.admin-body)[data-theme="dark"] .category-card {
    background-color: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Text Colors - Frontend Only */
body:not(.admin-body)[data-theme="dark"] h1,
body:not(.admin-body)[data-theme="dark"] h2,
body:not(.admin-body)[data-theme="dark"] h3,
body:not(.admin-body)[data-theme="dark"] h4,
body:not(.admin-body)[data-theme="dark"] h5,
body:not(.admin-body)[data-theme="dark"] h6,
body:not(.admin-body)[data-theme="dark"] .section-title-modern,
body:not(.admin-body)[data-theme="dark"] .article-title-modern,
body:not(.admin-body)[data-theme="dark"] .sidebar-title {
    color: #f1f5f9;
}

body:not(.admin-body)[data-theme="dark"] p,
body:not(.admin-body)[data-theme="dark"] .article-excerpt,
body:not(.admin-body)[data-theme="dark"] .meta-item {
    color: #cbd5e1;
}

body:not(.admin-body)[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* Borders - Frontend Only */
body:not(.admin-body)[data-theme="dark"] .border,
body:not(.admin-body)[data-theme="dark"] .border-top,
body:not(.admin-body)[data-theme="dark"] .border-bottom,
body:not(.admin-body)[data-theme="dark"] .border-left,
body:not(.admin-body)[data-theme="dark"] .border-right {
    border-color: #334155 !important;
}

/* Inputs and Forms - Frontend Only */
body:not(.admin-body)[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
body:not(.admin-body)[data-theme="dark"] textarea,
body:not(.admin-body)[data-theme="dark"] select,
body:not(.admin-body)[data-theme="dark"] .form-control {
    background-color: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

body:not(.admin-body)[data-theme="dark"] input::placeholder,
body:not(.admin-body)[data-theme="dark"] textarea::placeholder {
    color: #94a3b8;
}

/* Navbar - Frontend Only */
body:not(.admin-body)[data-theme="dark"] .navbar,
body:not(.admin-body)[data-theme="dark"] .topbar {
    background-color: rgba(15, 23, 42, 0.98) !important;
}

/* Sidebar Sections - Frontend Only */
body:not(.admin-body)[data-theme="dark"] .sidebar-section-header {
    background: #1e293b;
    color: #f1f5f9;
}

body:not(.admin-body)[data-theme="dark"] .bg-light {
    background-color: #1e293b !important;
}

/* Modals - Frontend Only */
body:not(.admin-body)[data-theme="dark"] .modal-content,
body:not(.admin-body)[data-theme="dark"] .archive-modal-content,
body:not(.admin-body)[data-theme="dark"] .swal2-popup {
    background-color: rgba(30, 41, 59, 0.98) !important;
    color: #f1f5f9;
}

/* SweetAlert2 Z-Index Override - Available Everywhere */
.swal2-container,
.swal2-container.swal2-center,
.swal2-container.swal2-backdrop-show {
    z-index: 99999 !important;
}

/* Dropdown Menus - Frontend Only */
body:not(.admin-body)[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

body:not(.admin-body)[data-theme="dark"] .dropdown-item {
    color: #f1f5f9;
}

body:not(.admin-body)[data-theme="dark"] .dropdown-item:hover {
    background-color: #1e293b;
    color: #ff5555;
}

/* Tables - Frontend Only */
body:not(.admin-body)[data-theme="dark"] table {
    color: #f1f5f9;
}

body:not(.admin-body)[data-theme="dark"] thead {
    background-color: #1e293b;
    color: #f1f5f9;
}

body:not(.admin-body)[data-theme="dark"] tbody tr {
    border-color: #334155;
}

body:not(.admin-body)[data-theme="dark"] tbody tr:hover {
    background-color: #1e293b;
}

/* Scrollbar Styling for Dark Mode - Frontend Only */
body[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Featured Stories Section */
body[data-theme="dark"] .featured-modern-section {
    background-color: #1e293b !important;
}

body[data-theme="dark"] .section-title-modern {
    color: #f1f5f9 !important;
}

body[data-theme="dark"] .latest-featured-card {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

body[data-theme="dark"] .latest-featured-card:hover {
    background-color: #334155 !important;
}

body[data-theme="dark"] .latest-featured-label {
    background: linear-gradient(135deg, var(--god-primary) 0%, var(--god-primary-light) 100%) !important;
    color: #ffffff !important;
}

/* Featured category posts */
body[data-theme="dark"] .featured-cat-post {
    background-color: #1e293b !important;
}

body[data-theme="dark"] .featured-cat-post:hover {
    background-color: #334155 !important;
}

/* Section title line */
body[data-theme="dark"] .section-title-line {
    background: linear-gradient(90deg, transparent, var(--god-primary), transparent) !important;
}