/* iOS-Style Dark Mode - Centralized Colors */

/* CRITICAL: Prevent white flash on page load */
html.dark-mode {
    background-color: #000000 !important;
}

html.dark-mode body {
    background-color: #000000 !important;
}

/* Light Mode Variables (Default) */
:root {
    --ios-bg-primary: #F2F2F7;
    --ios-bg-secondary: #FFFFFF;
    --ios-bg-tertiary: #F5F5F5;
    --ios-card: #FFFFFF;
    --ios-text-primary: #000000;
    --ios-text-secondary: #8E8E93;
    --ios-text-tertiary: #C7C7CC;
    --ios-separator: #C6C6C8;
    --ios-accent-blue: #007AFF;
    --ios-accent-green: #34C759;
    --ios-accent-red: #FF3B30;
    --ios-accent-orange: #FF9500;
    --ios-shadow: rgba(0, 0, 0, 0.08);
}

/* Dark Mode Variables */
body.dark-mode {
    --ios-bg-primary: #000000;
    --ios-bg-secondary: #1C1C1E;
    --ios-bg-tertiary: #2C2C2E;
    --ios-card: #1C1C1E;
    --ios-text-primary: #FFFFFF;
    --ios-text-secondary: #8E8E93;
    --ios-text-tertiary: #48484A;
    --ios-separator: #38383A;
    --ios-accent-blue: #0A84FF;
    --ios-accent-green: #30D158;
    --ios-accent-red: #FF453A;
    --ios-accent-orange: #FF9F0A;
    --ios-shadow: rgba(0, 0, 0, 0.4);
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 8px;
}

.dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-mode-toggle i {
    font-size: 22px;
    color: #333;
    transition: all 0.3s ease;
}

body.dark-mode .dark-mode-toggle i {
    color: #FFD60A;
    text-shadow: 0 0 10px rgba(255, 214, 10, 0.5);
}

/* Header Cart Icon */
.header-cart-icon {
    font-size: 20px;
    color: #333;
    transition: color 0.3s ease;
}

body.dark-mode .header-cart-icon {
    color: #FFFFFF;
}

/* iOS-style transition for all elements */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Global Dark Mode Overrides - iOS Pure Black */
body.dark-mode {
    background-color: #000000 !important;
    color: #FFFFFF;
}

/* Header Dark Mode */
body.dark-mode .header {
    background: #000000 !important;
    border-bottom: 1px solid #38383A;
    box-shadow: none;
}

body.dark-mode .header-content {
    background: transparent;
}

/* Location Button Dark Mode */
body.dark-mode .b_e271 {
    background: rgba(44, 44, 46, 0.9) !important;
    border-color: #48484A !important;
}

body.dark-mode .b_e271:hover {
    background: rgba(58, 58, 60, 0.95) !important;
}

body.dark-mode .b_e271::before {
    color: #FF453A;
}

body.dark-mode .ZXYPR_HW {
    color: #FFFFFF !important;
}

/* Cards and Containers */
body.dark-mode .service-card-new,
body.dark-mode .category-card,
body.dark-mode .info-item,
body.dark-mode .home-tab,
body.dark-mode .modal-content,
body.dark-mode .popup-content,
body.dark-mode .booking-modal-content,
body.dark-mode .ios-booking-modal,
body.dark-mode .cart-popup,
body.dark-mode .pack-modal-content {
    background: #1C1C1E !important;
    border-color: #38383A !important;
}

/* Input Fields */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background: #2C2C2E !important;
    color: #FFFFFF !important;
    border-color: #38383A !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #8E8E93 !important;
}

/* Buttons */
body.dark-mode .btn-primary,
body.dark-mode .book-now-btn,
body.dark-mode .add-service-btn-new {
    background: #0A84FF !important;
    color: #FFFFFF !important;
}

body.dark-mode .btn-secondary {
    background: #48484A !important;
    color: #FFFFFF !important;
}

/* Overlays and Modals */
body.dark-mode .modal-overlay,
body.dark-mode .popup-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Sticky Footer */
body.dark-mode .sticky-booking-footer,
body.dark-mode .bottom-nav {
    background: rgba(28, 28, 30, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top-color: #38383A !important;
}

/* Separators and Borders */
body.dark-mode hr,
body.dark-mode .divider {
    border-color: #38383A !important;
}

/* Price and Badge Colors */
body.dark-mode .price-new-badge {
    color: #30D158 !important;
}

body.dark-mode .old-price {
    color: #8E8E93 !important;
}

/* FAQ and Content Sections - Complete Dark Mode */
body.dark-mode .faq-section {
    background: #000000 !important;
}

body.dark-mode .faq-section h2 {
    color: #FFFFFF !important;
}

body.dark-mode .faq-question {
    color: #FFFFFF !important;
    background: transparent !important;
}

body.dark-mode .faq-question i {
    color: #8E8E93 !important;
}

body.dark-mode .faq-answer {
    color: #EBEBF5 !important;
}

body.dark-mode .faq-item {
    border-color: #38383A !important;
}

body.dark-mode .seo-section {
    background: #1C1C1E !important;
}

body.dark-mode .article-card {
    background: #2C2C2E !important;
}

body.dark-mode .article-title {
    color: #FFFFFF !important;
}

body.dark-mode .article-content {
    color: #EBEBF5 !important;
}

/* Category Scroll - Cat Tab (Glassmorphism) */
body.dark-mode .cat-tab {
    background: rgba(44, 44, 46, 0.9) !important;
    border-color: #48484A !important;
}

body.dark-mode .cat-tab i,
body.dark-mode .cat-tab span {
    color: #FFFFFF !important;
}

body.dark-mode .cat-tab.active {
    background: #0A84FF !important;
    border-color: #0A84FF !important;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4) !important;
}

body.dark-mode .cat-tab.active i,
body.dark-mode .cat-tab.active span {
    color: #FFFFFF !important;
}

/* Category Tab (Alternative Class) */
body.dark-mode .category-tab {
    background: #2C2C2E !important;
    color: #FFFFFF !important;
}

body.dark-mode .category-tab.active {
    background: #0A84FF !important;
    color: #FFFFFF !important;
}

/* Service Cards */
body.dark-mode .service-card-new {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .service-title-new,
body.dark-mode .service-description-new li {
    color: #FFFFFF !important;
}

body.dark-mode .service-rating-new,
body.dark-mode .duration-badge {
    color: #8E8E93 !important;
}

/* iOS Booking Modal */
body.dark-mode .ios-booking-header {
    background: #1C1C1E !important;
    border-bottom-color: #38383A !important;
}

body.dark-mode .ios-booking-step {
    background: #2C2C2E !important;
}

/* Related Services */
body.dark-mode .service-scroll-card {
    background: #1C1C1E !important;
}

/* Navigation - Full White Color in Dark Mode */
body.dark-mode .whatsapp-nav-item,
body.dark-mode .whatsapp-nav-item i,
body.dark-mode .whatsapp-nav-item span {
    color: #FFFFFF !important;
}

body.dark-mode .whatsapp-nav-item i {
    font-weight: 400 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark-mode .whatsapp-nav-item span {
    font-weight: 400 !important;
    font-size: 10px !important;
}

body.dark-mode .whatsapp-nav-item.active,
body.dark-mode .whatsapp-nav-item.active i,
body.dark-mode .whatsapp-nav-item.active span {
    color: #0A84FF !important;
}

body.dark-mode .nav-main-group,
body.dark-mode .nav-settings-group,
body.dark-mode .nav-location-group {
    background: rgba(28, 28, 30, 0.95) !important;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

/* Page Content - All Text White in Dark Mode */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode li,
body.dark-mode span,
body.dark-mode label,
body.dark-mode .section-title,
body.dark-mode .page-title,
body.dark-mode .article-title,
body.dark-mode .article-content,
body.dark-mode .section-desc {
    color: #FFFFFF !important;
}

/* Service Page Specific Styles */
body.dark-mode .category-page-container,
body.dark-mode .services-list,
body.dark-mode main {
    background: #000000 !important;
}

body.dark-mode .loading-placeholder p {
    color: #8E8E93 !important;
}

/* Category Scroll Container */
body.dark-mode .category-scroll {
    background: transparent !important;
}

/* Links in Dark Mode - Keep service titles white */
body.dark-mode a:not(.whatsapp-nav-item):not(.book-now-btn):not(.service-title-new):not([class*="title"]) {
    color: #0A84FF !important;
}

/* Service Card Titles must be WHITE */
body.dark-mode .service-title-new,
body.dark-mode .service-card-new h3,
body.dark-mode .service-card-new .service-title-new {
    color: #FFFFFF !important;
}

/* View Details link is blue */
body.dark-mode .view-details-link {
    color: #0A84FF !important;
}

/* ============================================================
   NAVIGATION ICONS - DARK MODE FIX
   ============================================================ */
body.dark-mode .whatsapp-nav-item i {
    color: #ffffff !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased;
}

body.dark-mode .whatsapp-nav-item.active i {
    color: #0A84FF !important;
}

body.dark-mode .whatsapp-nav-item span {
    color: #ffffff !important;
}

body.dark-mode .whatsapp-nav-item.active span {
    color: #0A84FF !important;
}

/* Fix Font Awesome icons in dark mode */
body.dark-mode .fas,
body.dark-mode .fa-solid,
body.dark-mode .far,
body.dark-mode .fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

body.dark-mode i[class*="fa-"] {
    color: inherit;
}

/* ============================================================
   CATEGORY HEADER SLIDER - 3D EFFECT
   ============================================================ */
/* Category tabs container */
.category-tabs-container,
.cats,
#cats {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    perspective: 1000px;
}

.category-tabs-container::-webkit-scrollbar,
.cats::-webkit-scrollbar,
#cats::-webkit-scrollbar {
    display: none;
}

/* Individual category tab */
.cat-tab,
.category-tab {
    flex-shrink: 0;
    padding: 10px 18px;
    border-radius: 20px;
    background: #f5f5f7;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transform-style: preserve-3d;
}

.cat-tab:hover:not(.active),
.category-tab:hover:not(.active) {
    background: #e8e8ed;
    transform: translateY(-2px);
}

/* ACTIVE CATEGORY - 3D SLIDER EFFECT */
.cat-tab.active,
.category-tab.active {
    background: linear-gradient(135deg, #001f5c 0%, #000033 100%);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 22px;
    box-shadow:
        0 8px 25px rgba(0, 31, 92, 0.4),
        0 3px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-3px) scale(1.05) rotateX(-5deg);
    border-radius: 25px;
    position: relative;
    z-index: 10;
}

/* Left/right tabs near active - 3D perspective */
.cat-tab.active+.cat-tab,
.category-tab.active+.category-tab {
    transform: translateY(-1px) rotateY(-8deg);
}

/* White shadow/glow for 3D depth */
.cat-tab.active::before,
.category-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -3px;
    right: -3px;
    bottom: -4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    z-index: -1;
    filter: blur(2px);
}

/* Category icon in active tab */
.cat-tab.active i,
.category-tab.active i {
    color: #ffffff !important;
}

/* ============================================================
   DARK MODE - CATEGORY TABS
   ============================================================ */
body.dark-mode .cat-tab,
body.dark-mode .category-tab {
    background: #2c2c2e;
    color: #ffffff !important;
    border-color: #3a3a3c;
}

body.dark-mode .cat-tab:hover:not(.active),
body.dark-mode .category-tab:hover:not(.active) {
    background: #3a3a3c;
}

body.dark-mode .cat-tab.active,
body.dark-mode .category-tab.active {
    background: linear-gradient(135deg, #001f5c 0%, #000033 100%);
    color: #ffffff !important;
    box-shadow:
        0 8px 25px rgba(0, 31, 92, 0.6),
        0 3px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 20px rgba(255, 255, 255, 0.08);
}

/* ============================================================
   HEADER CATEGORY TITLES - WHITE TEXT IN DARK MODE
   ============================================================ */
body.dark-mode .category-title,
body.dark-mode .service-header h1,
body.dark-mode .page-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
    color: #ffffff !important;
}

body.dark-mode .category-subtitle,
body.dark-mode .page-subtitle {
    color: #98989f !important;
}

/* ============================================================
   HOME PAGE CATEGORIES - DARK MODE
   ============================================================ */
/* Categories Grid Container */
body.dark-mode .categories-grid-new {
    background: transparent !important;
}

/* Main Category Cards (AC Services, Home Appliances, Electrician Plumber) */
body.dark-mode .category-card-new {
    background: #1C1C1E !important;
    border-color: #38383A !important;
}

body.dark-mode .category-card-new:hover {
    background: #2C2C2E !important;
}

body.dark-mode .category-card-new h3 {
    color: #FFFFFF !important;
}

/* Image Wrapper Background */
body.dark-mode .category-card-new .cat-image-wrapper {
    background: #2C2C2E !important;
}

/* Urban Company Style Categories Grid */
body.dark-mode .uc-categories-grid {
    background: transparent !important;
}

body.dark-mode .uc-category-item {
    background: #1C1C1E !important;
    border-color: #38383A !important;
}

body.dark-mode .uc-category-item:hover {
    border-color: #0A84FF !important;
    background: #2C2C2E !important;
}

body.dark-mode .uc-category-title {
    color: #FFFFFF !important;
}

/* Category Popup Dark Mode */
body.dark-mode .category-popup .popup-content {
    background: #1C1C1E !important;
}

body.dark-mode .popup-title {
    color: #FFFFFF !important;
}

body.dark-mode .popup-option {
    background: #2C2C2E !important;
}

body.dark-mode .popup-option:hover {
    background: #3A3A3C !important;
}

body.dark-mode .popup-option span {
    color: #FFFFFF !important;
}

/* Category Services in Popup */
body.dark-mode .category-service-item {
    background: #2C2C2E !important;
    border-color: #38383A !important;
}

body.dark-mode .category-service-item:hover {
    background: #3A3A3C !important;
    border-color: #0A84FF !important;
}

body.dark-mode .category-service-name {
    color: #FFFFFF !important;
}

body.dark-mode .close-popup {
    color: #8E8E93 !important;
}

body.dark-mode .close-popup:hover {
    color: #FFFFFF !important;
}

/* SEO Section Dark Mode */
body.dark-mode .seo-articles {
    background: #000000 !important;
}

body.dark-mode .seo-keywords-section {
    background: #1C1C1E !important;
    border-color: #38383A !important;
}

body.dark-mode .seo-keywords-section .container {
    color: #EBEBF5 !important;
}

body.dark-mode .seo-keywords-section span[style*="color: #333"] {
    color: #FFFFFF !important;
}

/* Hero Search Box Dark Mode */
body.dark-mode .hero-search-box {
    background: #1C1C1E !important;
    border-color: #38383A !important;
}

body.dark-mode .hero-search-box i {
    color: #8E8E93 !important;
}

body.dark-mode .hero-search-box input {
    color: #FFFFFF !important;
}

body.dark-mode .hero-search-box input::placeholder {
    color: #8E8E93 !important;
}