/* ==========================================================================
   SmartQRPrint - Global Dark Mode Stylesheet (Works across Public, Admin, Shop, Agent & Upload)
   ========================================================================== */

[data-bs-theme="dark"] body {
    background-color: #0b1120 !important;
    color: #e2e8f0 !important;
}

/* Override utility classes that hardcode light backgrounds/text */
[data-bs-theme="dark"] .bg-white {
    background-color: #111827 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
    border-color: #1f2937 !important;
}

/* Cards, Modals & Dropdowns */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .stat-card-premium {
    background-color: #111827 !important;
    color: #e2e8f0 !important;
    border-color: #1f2937 !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #1e293b !important;
}

/* Public Website Navbar & Sections */
[data-bs-theme="dark"] .navbar-saas {
    background: rgba(11, 17, 32, 0.94) !important;
    border-bottom: 1px solid #1f2937 !important;
}
[data-bs-theme="dark"] .navbar-saas .nav-link {
    color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .navbar-saas .nav-link:hover {
    color: #60a5fa !important;
}
[data-bs-theme="dark"] .btn-outline-custom {
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .hero-section,
[data-bs-theme="dark"] .section-light,
[data-bs-theme="dark"] section {
    background-color: #0b1120 !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .feature-card,
[data-bs-theme="dark"] .pricing-card,
[data-bs-theme="dark"] .step-card {
    background-color: #111827 !important;
    border-color: #1f2937 !important;
    color: #e2e8f0 !important;
}

/* Admin, Shop & Agent Sidebars & Topbars */
[data-bs-theme="dark"] .sidebar,
[data-bs-theme="dark"] .agent-sidebar {
    background-color: #111827 !important;
    border-right: 1px solid #1f2937 !important;
}
[data-bs-theme="dark"] .sidebar-brand,
[data-bs-theme="dark"] .agent-brand {
    border-bottom-color: #1f2937 !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .sidebar-nav .nav-link,
[data-bs-theme="dark"] .agent-nav .nav-link {
    color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .sidebar-nav .nav-link:hover,
[data-bs-theme="dark"] .agent-nav .nav-link:hover {
    background-color: #1e293b !important;
    color: #60a5fa !important;
}
[data-bs-theme="dark"] .sidebar-nav .nav-link.active,
[data-bs-theme="dark"] .agent-nav .nav-link.active {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: #60a5fa !important;
}
[data-bs-theme="dark"] .top-navbar,
[data-bs-theme="dark"] .admin-topbar,
[data-bs-theme="dark"] .agent-topbar,
[data-bs-theme="dark"] .portal-shop-header {
    background: rgba(17, 24, 39, 0.95) !important;
    border-bottom: 1px solid #1f2937 !important;
    color: #f8fafc !important;
}

/* Customer Upload Portal */
[data-bs-theme="dark"] .portal-body {
    background-color: #0b1120 !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .upload-dropzone {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* Forms, Tables & Buttons */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .table {
    --bs-table-bg: #111827;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: #1f2937;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table thead th {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .btn-light {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .list-group-item {
    background-color: #111827 !important;
    border-color: #1f2937 !important;
    color: #e2e8f0 !important;
}

/* Theme Toggle Button Styling */
.sqp-theme-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.navbar-saas .nav-link {
    white-space: nowrap;
    font-size: 0.92rem;
    padding: 7px 12px !important;
}
.navbar-saas .btn-primary-gradient,
.navbar-saas .btn-outline-custom {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 18px !important;
    font-size: 0.88rem !important;
}
.sqp-theme-btn:hover {
    transform: scale(1.06);
}
[data-bs-theme="dark"] .sqp-theme-btn {
    background: #1e293b;
    border-color: #334155;
    color: #fbbf24;
}

/* ==========================================================================
   Global Mobile & Tablet Responsive Enhancements (<= 991px & <= 576px)
   ========================================================================== */

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991px) {
    .main-wrapper,
    .admin-wrapper,
    .agent-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .content-area,
    .admin-content,
    .agent-content {
        padding: 16px !important;
    }

    .top-navbar,
    .admin-topbar,
    .agent-topbar {
        padding: 12px 16px !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    .navbar-saas .navbar-collapse {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

@media (max-width: 767px) {
    .top-navbar h5,
    .admin-topbar h5,
    .agent-topbar h5 {
        font-size: 1rem !important;
    }

    .stat-card-premium,
    .service-card-premium,
    .card {
        border-radius: 14px !important;
    }

    .btn {
        min-height: 36px;
    }

    .modal-dialog {
        margin: 0.75rem !important;
    }

    h1.display-4, h1.display-5, .hero-title {
        font-size: 1.85rem !important;
        line-height: 1.25 !important;
    }
}

@media (max-width: 576px) {
    .content-area,
    .admin-content,
    .agent-content {
        padding: 12px !important;
    }

    .top-navbar .btn-outline-primary,
    .admin-topbar .btn-outline-secondary {
        font-size: 0.78rem !important;
        padding: 5px 10px !important;
    }

    .portal-shop-header .shop-avatar {
        width: 38px !important;
        height: 38px !important;
        font-size: 1rem !important;
    }
}

/* Dark Mode Fix for Pricing Price, Headings & Hardcoded Dark Text */
[data-bs-theme="dark"] .pricing-price,
[data-bs-theme="dark"] .pricing-card .pricing-price,
[data-bs-theme="dark"] .hero-title,
[data-bs-theme="dark"] .qr-poster-title,
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .pricing-price span {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .hero-floating-badge,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .accordion-button {
    background-color: #111827 !important;
    color: #f1f5f9 !important;
    border-color: #1f2937 !important;
}

/* Dark Mode Fix for How-It-Works Gradient Cards & Inline Section Gradients */
[data-bs-theme="dark"] section,
[data-bs-theme="dark"] #how-it-works,
[data-bs-theme="dark"] #features,
[data-bs-theme="dark"] #pricing,
[data-bs-theme="dark"] #demo,
[data-bs-theme="dark"] #partner {
    background: #0b1120 !important;
    background-image: none !important;
}

[data-bs-theme="dark"] .how-card-step1,
[data-bs-theme="dark"] .how-card-step2,
[data-bs-theme="dark"] .how-card-step3,
[data-bs-theme="dark"] .how-card-step4 {
    background: #111827 !important;
    background-image: none !important;
    border: 1px solid #1f2937 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .how-card-step1 p,
[data-bs-theme="dark"] .how-card-step2 p,
[data-bs-theme="dark"] .how-card-step3 p,
[data-bs-theme="dark"] .how-card-step4 p {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .flow-step-icon {
    background: rgba(37, 99, 235, 0.16) !important;
    border-radius: 12px;
    padding: 8px;
}

[data-bs-theme="dark"] .bg-indigo-subtle {
    background-color: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
}

/* Dark Mode Fix for Shop Dashboard Service Cards, Glass Cards & Arrow Buttons */
[data-bs-theme="dark"] .service-card-premium,
[data-bs-theme="dark"] .glass-card {
    background: #111827 !important;
    background-color: #111827 !important;
    border-color: #1f2937 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .service-card-premium:hover {
    background: #172033 !important;
    border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .service-arrow-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] footer.bg-white {
    background-color: #111827 !important;
    border-top-color: #1f2937 !important;
    color: #94a3b8 !important;
}
