/* ==========================================================================
   Dark Mode Theme for McAllen Next
   ========================================================================== */

/* Dark Mode Theme Variables */
[data-theme="dark"] {
    --theme-bg-primary: #121212;
    --theme-bg-secondary: #1E1E1E;
    --theme-bg-card: #252525;
    --theme-text-primary: #E5E5E5;
    --theme-text-secondary: #B0B0B0;
    --theme-text-muted: #888888;
    --theme-border: #333333;
    --theme-border-light: #2a2a2a;
    --theme-shadow: rgba(0, 0, 0, 0.3);
    --theme-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.5);
    --theme-preloader-bg: #121212;
    --theme-input-bg: #2a2a2a;
    --theme-input-border: #404040;
    /* Override brand colors for dark mode if needed */
    --mcallen-light-slate: #1E1E1E;
    /* Bootstrap card variables override */
    --bs-card-bg: #252525;
    --bs-body-bg: #252525;
    --bs-card-border-color: #333333;
    --bs-list-group-bg: #252525;
    --bs-list-group-border-color: #333333;
    --bs-list-group-action-hover-bg: #2a2a2a;
    --bs-list-group-action-active-bg: #1E3A8A;
}

/* ==========================================================================
   Base Elements
   ========================================================================== */

[data-theme="dark"] body,
[data-theme="dark"] html {
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .preloader {
    background-color: var(--theme-preloader-bg);
}

/* ==========================================================================
   Navigation & Header
   ========================================================================== */

[data-theme="dark"] .header.header-light {
    background: var(--theme-bg-card);
    border-bottom: 1px solid var(--theme-border);
}

[data-theme="dark"] .navigation {
    background: var(--theme-bg-card);
}

[data-theme="dark"] .nav-menu > li > a {
    color: var(--theme-text-primary);
}

[data-theme="dark"] .nav-menu > li > a:hover {
    color: var(--mcallen-sky-blue);
}

[data-theme="dark"] .mobile_nav {
    background: var(--theme-bg-card);
}

/* Mobile sidebar navigation background */
[data-theme="dark"] .nav-menus-wrapper {
    background: var(--theme-bg-card);
}

/* Logo switching - show white logo in dark mode, colored logo in light mode */
/* Light mode - hide white logo, show colored logo */
[data-theme="light"] .nav-brand img[src*="LogoWhite"] {
    display: none !important;
}

[data-theme="light"] .nav-brand img[src*="LogoOnly"] {
    display: inline-block !important;
}

/* Dark mode - show white logo, hide colored logo */
[data-theme="dark"] .nav-brand img[src*="LogoWhite"] {
    display: inline-block !important;
}

[data-theme="dark"] .nav-brand img[src*="LogoOnly"] {
    display: none !important;
}

/* Default (no theme set yet) - show colored logo */
.nav-brand img[src*="LogoWhite"] {
    display: none;
}

.nav-brand img[src*="LogoOnly"] {
    display: inline-block;
}

/* ==========================================================================
   Cards & Containers
   ========================================================================== */

[data-theme="dark"] .Goodup-grid-wrap,
[data-theme="dark"] .gup_blg_grid_box,
[data-theme="dark"] .sidebar-card,
[data-theme="dark"] .place-group-card,
[data-theme="dark"] .day-card,
[data-theme="dark"] .vrt-list-wrap {
    background: var(--theme-bg-card);
    box-shadow: var(--theme-shadow-card);
}

[data-theme="dark"] .place-group-header,
[data-theme="dark"] .sidebar-card-header {
    background: var(--theme-bg-secondary);
    border-bottom: 1px solid var(--theme-border);
}

[data-theme="dark"] .post-accordion-item {
    border-bottom: 1px solid var(--theme-border-light);
}

[data-theme="dark"] .post-accordion-header:hover,
[data-theme="dark"] .sidebar-list-item:hover,
[data-theme="dark"] .sidebar-event-item:hover {
    background: var(--theme-bg-secondary);
}

/* Bootstrap Cards & List Groups */
[data-theme="dark"] .card {
    background: var(--bs-card-bg);
    border-color: var(--bs-card-border-color);
}

[data-theme="dark"] .card-header {
    background: var(--theme-bg-secondary);
    border-bottom-color: var(--theme-border);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .card-body {
    background: var(--bs-card-bg);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .list-group-item {
    background: var(--bs-list-group-bg);
    border-color: var(--bs-list-group-border-color);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .list-group-item:hover {
    background: var(--bs-list-group-action-hover-bg);
}

[data-theme="dark"] .list-group-item.active {
    background: var(--bs-list-group-action-active-bg) !important;
    background-color: #1E3A8A !important;
    border-color: var(--bs-list-group-action-active-bg) !important;
    color: #ffffff !important;
}

/* Additional specificity for list group active items */
[data-theme="dark"] .list-group-item.list-group-item-action.active,
[data-theme="dark"] .list-group .list-group-item.active {
    background-color: #1E3A8A !important;
    border-color: #1E3A8A !important;
    color: #ffffff !important;
}

/* Fix hard-coded text colors */
[data-theme="dark"] .post-accordion-header .post-user,
[data-theme="dark"] .single-post-wrapper .post-user,
[data-theme="dark"] .place-group-header h5 a {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .post-accordion-header .post-user a:hover,
[data-theme="dark"] .single-post-wrapper .post-user a:hover,
[data-theme="dark"] .place-group-header h5 a:hover {
    color: var(--mcallen-sky-blue) !important;
}

/* Fix hard-coded link colors */
[data-theme="dark"] .place-group-header .view-all-link {
    color: var(--mcallen-sky-blue) !important;
}

[data-theme="dark"] .place-group-header .view-all-link:hover {
    color: #60A5FA !important; /* Lighter blue for hover */
}

/* Footer social icon links */
[data-theme="dark"] .theme-cl {
    color: var(--mcallen-sky-blue) !important;
}

[data-theme="dark"] .theme-cl:hover {
    color: #60A5FA !important; /* Lighter blue for hover */
}

[data-theme="dark"] a.theme-cl {
    color: var(--mcallen-sky-blue) !important;
}

[data-theme="dark"] a.theme-cl:hover {
    color: #60A5FA !important;
}

/* ==========================================================================
   Sections & Backgrounds
   ========================================================================== */

[data-theme="dark"] section,
[data-theme="dark"] .light-bg,
[data-theme="dark"] .gray-simple,
[data-theme="dark"] .gray {
    background: var(--theme-bg-secondary);
}

[data-theme="dark"] .bg-white {
    background: var(--theme-bg-card) !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

[data-theme="dark"] footer,
[data-theme="dark"] footer.style-2,
[data-theme="dark"] .light-footer.skin-light-footer {
    background: var(--theme-bg-card);
    border-top: 1px solid var(--theme-border);
}

[data-theme="dark"] .footer-middle {
    background: var(--theme-bg-card);
}

[data-theme="dark"] .footer_widget .widget_title {
    color: var(--theme-text-primary);
}

[data-theme="dark"] .footer-menu li a {
    color: var(--theme-text-secondary);
}

[data-theme="dark"] .footer-menu li a:hover {
    color: var(--mcallen-sky-blue);
}

[data-theme="dark"] .footer-bottom {
    border-top: 1px solid var(--theme-border);
    background: var(--theme-bg-card);
}

[data-theme="dark"] .footer-bottom p {
    color: var(--theme-text-secondary);
}

/* ==========================================================================
   Typography & Text
   ========================================================================== */

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--theme-text-primary);
}

[data-theme="dark"] p {
    color: var(--theme-text-secondary);
}

[data-theme="dark"] a {
    color: var(--theme-text-primary);
}

[data-theme="dark"] a:hover {
    color: var(--mcallen-sky-blue);
}

[data-theme="dark"] .text-muted {
    color: var(--theme-text-muted) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--theme-text-primary) !important;
}

/* ==========================================================================
   Borders
   ========================================================================== */

[data-theme="dark"] .border,
[data-theme="dark"] .br-top,
[data-theme="dark"] .br-bottom,
[data-theme="dark"] .br-left,
[data-theme="dark"] .br-right {
    border-color: var(--theme-border) !important;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--theme-input-bg);
    border-color: var(--mcallen-sky-blue);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--theme-text-muted);
}

/* ==========================================================================
   Specific Component Overrides
   ========================================================================== */

/* Accordion Buttons */
[data-theme="dark"] .accordion-button {
    color: var(--theme-text-primary);
    background-color: var(--theme-bg-card);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    color: var(--theme-text-primary);
    background-color: var(--theme-bg-secondary);
}

[data-theme="dark"] .accordion-button:focus {
    box-shadow: none;
    border-color: var(--theme-border);
}

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

[data-theme="dark"] .accordion-item {
    background-color: var(--theme-bg-card);
    border-color: var(--theme-border);
}

[data-theme="dark"] .accordion-body {
    background-color: var(--theme-bg-card);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .accordion .card-header button {
    color: var(--theme-text-primary);
}

/* Post images */
[data-theme="dark"] .post-image-container {
    background: var(--theme-bg-secondary);
}

/* Sidebar widgets */
[data-theme="dark"] .sidebar-list-thumb,
[data-theme="dark"] .sidebar-thumb {
    background: var(--theme-bg-secondary);
}

/* Event badges */
[data-theme="dark"] .event-date-badge {
    background: rgba(22, 163, 74, 0.2);
}

/* Feature tags */
[data-theme="dark"] .vrt-list-features ul li a {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
}

[data-theme="dark"] .vrt-list-features ul li a:hover {
    background: rgba(37, 99, 235, 0.2);
}

/* Tab navigation */
[data-theme="dark"] .nav-tabs.small-tab {
    border-bottom: 2px solid var(--theme-border);
}

[data-theme="dark"] .nav-tabs.small-tab .nav-link {
    color: var(--theme-text-secondary);
}

[data-theme="dark"] .nav-tabs.small-tab .nav-link:hover {
    color: var(--theme-text-primary);
}

/* Place banner (keep overlay for readability) */
[data-theme="dark"] .place-banner {
    background-color: #0a0a0a;
}

/* ==========================================================================
   Theme Toggle Button Styling
   ========================================================================== */

.theme-toggle {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: inherit;
    font-size: 1.2rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    color: var(--mcallen-sky-blue);
}

.theme-toggle:focus {
    outline: 2px solid var(--mcallen-sky-blue);
    outline-offset: 2px;
}

.theme-toggle-icon {
    transition: transform 0.3s ease;
}

/* Header toggle specific */
.nav-menu-social .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer toggle specific */
.footer-widget .theme-toggle {
    color: var(--theme-text-secondary);
}

[data-theme="dark"] .footer-widget .theme-toggle {
    color: var(--theme-text-primary);
}

/* ==========================================================================
   Smooth Transitions
   ========================================================================== */

body,
.header,
.navigation,
.footer,
.Goodup-grid-wrap,
.gup_blg_grid_box,
.sidebar-card,
.place-group-card,
.form-control {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ==========================================================================
   Search Bar Dark Mode Styles
   ========================================================================== */

[data-theme="dark"] .search-bar-collapse {
    background: var(--theme-bg-primary);
    border-bottom: 1px solid var(--theme-border);
}

[data-theme="dark"] .search-bar-collapse.show {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .search-bar-form .input-group {
    background: var(--theme-bg-secondary);
}

[data-theme="dark"] .search-bar-form .form-control {
    color: var(--theme-text-primary);
}

[data-theme="dark"] .btn-close-search {
    color: var(--theme-text-secondary);
}

[data-theme="dark"] .btn-close-search:hover {
    color: var(--theme-text-primary);
}

[data-theme="dark"] .search-toggle:hover {
    color: var(--mcallen-sky-blue);
}

/* ==========================================================================
   Bootstrap Utility Class Overrides
   ========================================================================== */

/* Override light background utilities that conflict with dark mode */
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-light-success,
[data-theme="dark"] .bg-light-primary,
[data-theme="dark"] .bg-light-info,
[data-theme="dark"] .bg-light-warning {
    background-color: var(--theme-bg-card) !important;
}

/* Shadow utilities for dark mode */
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-lg {
    box-shadow: var(--theme-shadow-card) !important;
}

/* Ensure card backgrounds are properly set with higher specificity */
[data-theme="dark"] .card.border-0,
[data-theme="dark"] .card.shadow-sm {
    background-color: var(--bs-card-bg) !important;
}

/* ==========================================================================
   Everyday / Weekends Page Components
   ========================================================================== */

/* Weekend Day Cards */
[data-theme="dark"] .weekend-day-card {
    background: var(--theme-bg-card);
    box-shadow: var(--theme-shadow-card);
}

[data-theme="dark"] .weekend-day-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .weekend-day-card.featured-weekend {
    border-color: #b8860b;
    box-shadow: 0 6px 24px rgba(184, 134, 11, 0.2);
}

[data-theme="dark"] .weekend-day-title {
    color: var(--theme-text-primary);
}

[data-theme="dark"] .weekend-day-desc {
    color: var(--theme-text-secondary);
}

[data-theme="dark"] .weekend-card-footer {
    border-top-color: var(--theme-border);
}

[data-theme="dark"] .feature-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #93a6f8;
}

/* Stat Cards */
[data-theme="dark"] .stat-card {
    background: var(--theme-bg-card);
    box-shadow: var(--theme-shadow-card);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .stat-number {
    color: var(--theme-text-primary);
}

[data-theme="dark"] .stat-label {
    color: var(--theme-text-secondary);
}

/* Feature Highlights */
[data-theme="dark"] .feature-highlight {
    background: var(--theme-bg-card);
    box-shadow: var(--theme-shadow-card);
}

[data-theme="dark"] .feature-highlight:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .feature-highlight-content h5 {
    color: var(--theme-text-primary);
}

/* Weekend Hero Section */
[data-theme="dark"] .weekend-hero {
    background: linear-gradient(135deg, #2d2006 0%, #3d2e0a 100%) !important;
}

[data-theme="dark"] .weekend-hero h1,
[data-theme="dark"] .weekend-hero p,
[data-theme="dark"] .weekend-hero .lead {
    color: var(--theme-text-primary) !important;
}

[data-theme="dark"] .weekend-hero .label {
    background: rgba(255, 234, 167, 0.15) !important;
    color: #fdcb6e !important;
}

[data-theme="dark"] .weekend-hero-wave {
    background: var(--theme-bg-secondary) !important;
}
