/* Custom CSS for News Mitra Portal */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Light Mode Variables */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --border-color: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --transition-speed: 0.3s;
    --reading-progress-color: #2563eb;
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --border-color: #1f2937;
    --card-bg: rgba(17, 24, 39, 0.85);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    --reading-progress-color: #3b82f6;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Glassmorphism Navbar */
.navbar-custom {
    background-color: rgba(var(--bg-secondary), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}
.navbar-custom .navbar-brand {
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
}
.navbar-custom .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-speed) ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}
.navbar-custom .nav-link:hover, .navbar-custom .nav-link.active {
    color: var(--accent-color);
    background-color: var(--accent-glow);
}

/* Theme Switch Button */
.theme-toggle-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}
.theme-toggle-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

/* Cards & Layout */
.card-premium {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color var(--transition-speed) ease;
    overflow: hidden;
}
.card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    border-color: var(--accent-color);
}
.card-premium .card-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.card-premium .card-img-top {
    object-fit: cover;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-premium:hover .card-img-top {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-color);
    color: #ffffff;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Main Search Bar */
.search-form-custom .form-control {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 30px;
    padding-left: 20px;
    transition: all var(--transition-speed) ease;
}
.search-form-custom .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.search-form-custom .btn {
    border-radius: 30px;
    padding: 0.375rem 1.25rem;
}

/* Reading Progress Bar (Post details) */
#progress-container {
    position: fixed;
    top: 56px; /* Below navbar */
    left: 0;
    width: 100%;
    height: 4px;
    background-color: transparent;
    z-index: 1010;
}
#progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--reading-progress-color);
    transition: width 0.1s ease-out;
}

/* Footer Styling */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    margin-top: auto;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}
footer h5 {
    color: var(--text-primary);
}
footer hr {
    border-color: var(--border-color);
}

/* Common Details and Sidebar Widgets */
.sidebar-widget {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
}
.widget-title {
    font-size: 1.1rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    margin-bottom: 15px;
}

/* Comment Form & Comment Box */
.comment-box {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}
.comment-box:last-child {
    border-bottom: none;
}
.comment-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--accent-glow);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Typography styles */
.text-accent {
    color: var(--accent-color);
}
.hover-accent:hover {
    color: var(--accent-color) !important;
}

/* Admin Styling Overrides */
.admin-card {
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}
.admin-sidebar {
    min-height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Header Double-Decker & Mobile Drawer Styling */
.header-custom {
    background-color: var(--bg-secondary);
    transition: background-color var(--transition-speed) ease;
}

.top-bar {
    border-color: var(--border-color) !important;
}

.bg-secondary-custom {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.navbar-toggler-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background-color var(--transition-speed) ease;
}

.navbar-toggler-btn:hover {
    background-color: var(--accent-glow);
}

/* Category Navbar links (desktop) */
.bg-secondary-custom .nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.6rem 0.9rem !important;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.bg-secondary-custom .nav-link:hover, 
.bg-secondary-custom .nav-link.active {
    color: var(--accent-color) !important;
    background-color: var(--accent-glow);
}

/* Dropdown Menu customizations */
.dropdown-menu-custom {
    min-width: 210px;
    margin-top: 5px !important;
}

.dropdown-menu {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--card-shadow) !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
}

.dropdown-item:hover {
    color: var(--accent-color) !important;
    background-color: var(--accent-glow) !important;
}

/* Mega Menu for States (राज्य) */
.state-mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    width: 100% !important;
    margin-top: 0 !important;
    background-color: var(--bg-secondary) !important;
    border-radius: 0 0 20px 20px !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1.5rem !important;
}

.state-mega-menu h5 {
    font-size: 1rem;
    color: var(--accent-color);
}

.state-mega-menu .dropdown-item {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem !important;
}

/* Hover effect on desktop */
@media (min-width: 992px) {
    .bg-secondary-custom .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .bg-secondary-custom .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease, visibility var(--transition-speed) ease;
    }
    
    .state-mega-menu {
        top: 100%;
    }
}

/* Mobile Drawer (Offcanvas) Styles */
.mobile-drawer {
    background-color: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    width: 290px !important;
}

.mobile-drawer .offcanvas-header {
    border-bottom: 1px solid var(--border-color) !important;
}

.mobile-drawer .list-group-item {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color) !important;
    transition: all var(--transition-speed) ease;
}

.mobile-drawer .list-group-item:hover,
.mobile-drawer .list-group-item.active {
    color: var(--accent-color) !important;
    background-color: var(--accent-glow) !important;
}

/* Accordion inside mobile drawer */
.mobile-drawer .accordion-item {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.mobile-drawer .accordion-button {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: none !important;
    padding: 1rem 1.25rem !important;
}

.mobile-drawer .accordion-button:not(.collapsed) {
    color: var(--accent-color) !important;
}

.mobile-drawer .accordion-button::after {
    filter: invert(0.5);
}

[data-theme="dark"] .mobile-drawer .accordion-button::after {
    filter: invert(1);
}

.mobile-drawer .accordion-body {
    padding: 0 !important;
}

.mobile-drawer .accordion-body .list-group-item {
    font-size: 0.88rem;
    padding-left: 2rem !important;
    border-bottom: none !important;
}

.mobile-drawer .btn-close {
    filter: invert(0.5);
}

[data-theme="dark"] .mobile-drawer .btn-close {
    filter: invert(1);
}
