/* ==========================================================================
   FinTrGo Forced Desktop Mode Engine
   Applies only when html.force-desktop / body.force-desktop is present.
   Ensures desktop layout on all devices and viewport widths.
   ========================================================================== */

html.force-desktop,
body.force-desktop {
    min-width: 1200px !important;
    max-width: none !important;
    width: 100% !important;
    min-height: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    min-height: -webkit-fill-available !important;
    min-height: var(--desktop-viewport-min-height, 100vh) !important;
    background-color: #1f2937 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

body.force-desktop {
    display: flex !important;
    flex-direction: column !important;
}

/* ==========================================
   Dashboard & Authenticated Layout (/index, /withdraw, etc.)
   ========================================== */

body.force-desktop .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 240px !important;
    height: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    min-height: var(--desktop-viewport-min-height, 100vh) !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(0) !important;
    transition: transform 0.3s ease, width 0.3s ease !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
}

body.force-desktop.collapsed-sidebar .sidebar {
    transform: translateX(-100%) !important;
}

body.force-desktop .sidebar-toggle-btn {
    display: none !important;
}

body.force-desktop .sidebar-backdrop {
    display: none !important;
}

body.force-desktop header {
    position: fixed !important;
    top: 0 !important;
    left: 240px !important;
    right: 0 !important;
    min-width: 960px !important;
    height: 72px !important;
    padding: 0 2rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 500 !important;
    transition: left 0.3s ease !important;
}

body.force-desktop.collapsed-sidebar header {
    left: 0 !important;
    min-width: 1200px !important;
}

body.force-desktop header .menu-btn {
    display: block !important;
    font-size: 1.6rem !important;
    cursor: pointer !important;
}

body.force-desktop header .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

body.force-desktop header .logo span {
    display: inline !important;
}

body.force-desktop .main {
    margin-left: 240px !important;
    padding-top: 72px !important;
    min-width: 960px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 0 auto !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    min-height: -webkit-fill-available !important;
    min-height: var(--desktop-viewport-min-height, 100vh) !important;
    background: #f9fafb !important;
    transition: margin-left 0.3s ease !important;
}

body.force-desktop.collapsed-sidebar .main {
    margin-left: 0 !important;
    min-width: 1200px !important;
}

/* Page content wrappers expand to push footer flush to the bottom */
body.force-desktop .main > *:not(footer):not(script):not(style) {
    flex-grow: 1 !important;
}

/* Dashboard (/index) */
body.force-desktop .dashboard-content {
    padding: 2rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
    flex-grow: 1 !important;
}

body.force-desktop .stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
    padding: 0 !important;
}

body.force-desktop .payment-section {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
    padding: 0 !important;
}

body.force-desktop .stat-box {
    padding: 1.25rem !important;
}

body.force-desktop .stat-box h2 {
    font-size: 1.6rem !important;
}

body.force-desktop .payment-box {
    padding: 1.25rem !important;
}

body.force-desktop .payment-box h3 {
    font-size: 1.1rem !important;
}

body.force-desktop .payment-box .qr img {
    max-width: 150px !important;
}

/* Withdraw (/withdraw) */
body.force-desktop .withdraw-container {
    display: grid !important;
    grid-template-columns: 1fr 400px !important;
    gap: 2rem !important;
    padding: 2rem !important;
}

body.force-desktop .withdraw-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
}

body.force-desktop .withdraw-card.full-width {
    grid-column: span 2 !important;
}

body.force-desktop .withdraw-history-desktop {
    display: block !important;
}

body.force-desktop .withdraw-history-mobile {
    display: none !important;
}

/* Transactions (/transactions) */
body.force-desktop .trx-header-bar {
    margin-bottom: 0 !important;
}

body.force-desktop .trx-title-search-group {
    width: auto !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

body.force-desktop .compact-search-wrapper {
    width: auto !important;
    max-width: none !important;
    min-width: 260px !important;
}

body.force-desktop .filter-dropdowns {
    width: auto !important;
    display: flex !important;
    flex-direction: row !important;
}

body.force-desktop .filter-dropdowns select {
    flex: none !important;
    min-width: auto !important;
    width: auto !important;
}

body.force-desktop .status-pills {
    width: auto !important;
}

/* Raffle (/raffle) */
body.force-desktop .main-grid {
    display: grid !important;
    grid-template-columns: 1.3fr 0.7fr !important;
    gap: 2rem !important;
}

body.force-desktop .stats-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
}

/* Deposit (/deposit) */
body.force-desktop .input-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
}

/* KYC (/kyc) */
body.force-desktop .doc-type-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
}

/* Specific Inline Grid Layouts Restored */
body.force-desktop div[style*="grid-template-columns: 350px 1fr"] {
    grid-template-columns: 350px 1fr !important;
}

body.force-desktop div[style*="grid-template-columns: 1fr 2fr"] {
    grid-template-columns: 1fr 2fr !important;
}

body.force-desktop div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
}

body.force-desktop div[style*="grid-template-columns: repeat(2"] {
    grid-template-columns: repeat(2, 1fr) !important;
}

body.force-desktop div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr 1fr !important;
}

/* Admin Grids in Merchant & Tickets */
body.force-desktop .admin-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
}

body.force-desktop .form-group-cl.full {
    grid-column: span 2 !important;
}

/* ==========================================
   Public Pages (/about, /how-it-works, /merchant, /pricing, /contact, etc.)
   ========================================== */

body.force-desktop .public-navbar {
    padding: 1rem 8% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    min-width: 1200px !important;
    gap: 1rem !important;
}

body.force-desktop .public-nav-links {
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem !important;
    list-style: none !important;
}

body.force-desktop .public-nav-links a {
    font-size: 0.92rem !important;
    white-space: nowrap !important;
}

body.force-desktop .page-hero {
    padding: 6rem 8% 4rem !important;
    text-align: center !important;
}

body.force-desktop .page-hero h1 {
    font-size: 3rem !important;
}

body.force-desktop .cms-container {
    max-width: 1000px !important;
    margin: 4rem auto !important;
    padding: 0 2rem !important;
}

body.force-desktop .cms-wrapper {
    padding: 4rem 3.5rem !important;
    border-radius: 24px !important;
}

/* Contact Page (/contact) */
body.force-desktop .contact-wrapper {
    padding: 4rem 2rem !important;
}

body.force-desktop .contact-container {
    display: grid !important;
    grid-template-columns: 1fr 1.2fr !important;
    max-width: 1200px !important;
}

body.force-desktop .contact-info {
    padding: 4rem !important;
    gap: 3rem !important;
}

body.force-desktop .contact-form {
    padding: 4rem !important;
}

/* Pricing Page (/pricing) */
body.force-desktop .pr-calc-card,
body.force-desktop .cash-spotlight {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2.5rem !important;
    padding: 2.5rem !important;
}

body.force-desktop .pr-hero h1 {
    font-size: 3rem !important;
}

/* Merchant Page (/merchant) */
body.force-desktop .merch-hero h1 {
    font-size: 3rem !important;
}

body.force-desktop .merch-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
}

/* Public Footer */
body.force-desktop footer {
    margin-top: auto !important;
    width: 100% !important;
    background: #1f2937 !important;
    box-sizing: border-box !important;
}

body.force-desktop .footer-grid {
    display: grid !important;
    grid-template-columns: 2fr 1fr 1fr !important;
    gap: 3rem !important;
}

body.force-desktop .footer-bottom {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
}

/* ==========================================
   Global Resets for Force Desktop Mode
   ========================================== */

/* Tables */
body.force-desktop table {
    display: table !important;
    width: 100% !important;
}

body.force-desktop thead {
    display: table-header-group !important;
}

body.force-desktop tbody {
    display: table-row-group !important;
}

body.force-desktop tr {
    display: table-row !important;
}

body.force-desktop th,
body.force-desktop td {
    display: table-cell !important;
}

body.force-desktop .table-responsive,
body.force-desktop .table-wrapper {
    overflow-x: visible !important;
}

/* Reset forced flex directions and inline grids */
body.force-desktop form[style*="display: flex"][style*="gap: 10px"] {
    flex-direction: row !important;
    align-items: center !important;
}

body.force-desktop div[style*="display: flex"][style*="gap: 20px"] {
    flex-direction: row !important;
    align-items: center !important;
}

body.force-desktop form[style*="display: flex"][style*="gap: 10px"] > * {
    width: auto !important;
}

body.force-desktop div[style*="display: flex"][style*="gap: 20px"] > * {
    width: auto !important;
}

/* Modals */
body.force-desktop .modal-content {
    width: 95% !important;
    max-width: 600px !important;
    max-height: 90vh !important;
}

body.force-desktop .modal-body .form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.2rem !important;
}

body.force-desktop .modal-body .form-group.full-width {
    grid-column: span 2 !important;
}

/* Standard Dashboard Footer */
body.force-desktop footer {
    margin-top: auto !important;
    width: 100% !important;
    background: #1f2937 !important;
    box-sizing: border-box !important;
}

body.force-desktop footer .footer-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    max-width: 1200px !important;
    margin: auto !important;
}

body.force-desktop footer .footer-section {
    flex: 1 !important;
    min-width: 180px !important;
    text-align: left !important;
    margin-bottom: 1rem !important;
}

/* Live Chat widget isolation in desktop mode */
.lc-widget-box {
    position: fixed !important;
    z-index: 999991 !important;
}
.lc-widget-box:not(.active) {
    display: none !important;
}
.live-chat-trigger-btn {
    position: fixed !important;
    z-index: 999990 !important;
}
