/* Bulletproof Mobile Layout for Lawyer Dashboard */
/* This CSS completely resets the layout on mobile to ensure vertical stacking */

@media only screen and (max-width: 767px) {
    /* RESET ALL ELEMENTOR LAYOUT ON MOBILE */
    body.page-id-1155 *,
    body.page-id-1155 *::before,
    body.page-id-1155 *::after {
        float: none !important;
        position: static !important;
    }

    /* Override ALL Elementor flexbox and grid layouts */
    body.page-id-1155 .elementor-section,
    body.page-id-1155 .elementor-container,
    body.page-id-1155 .elementor-row,
    body.page-id-1155 .e-con,
    body.page-id-1155 .e-con-inner,
    body.page-id-1155 [data-element_type="container"],
    body.page-id-1155 [data-element_type="section"] {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        grid-template-columns: 1fr !important;
    }

    /* Force ALL columns to be full width blocks */
    body.page-id-1155 .elementor-column,
    body.page-id-1155 .elementor-col-10,
    body.page-id-1155 .elementor-col-20,
    body.page-id-1155 .elementor-col-25,
    body.page-id-1155 .elementor-col-30,
    body.page-id-1155 .elementor-col-33,
    body.page-id-1155 .elementor-col-40,
    body.page-id-1155 .elementor-col-50,
    body.page-id-1155 .elementor-col-60,
    body.page-id-1155 .elementor-col-66,
    body.page-id-1155 .elementor-col-70,
    body.page-id-1155 .elementor-col-75,
    body.page-id-1155 .elementor-col-80,
    body.page-id-1155 .elementor-col-90,
    body.page-id-1155 .elementor-col-100,
    body.page-id-1155 [class*="elementor-col-"] {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: none !important;
        margin: 0 !important;
        padding: 10px !important;
        float: none !important;
        position: static !important;
    }

    /* Force ALL widgets to be blocks */
    body.page-id-1155 .elementor-widget,
    body.page-id-1155 .elementor-widget-wrap,
    body.page-id-1155 .elementor-element {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        position: static !important;
        margin-bottom: 15px !important;
    }

    /* Target the Welcome gradient box specifically and force it to be a block */
    body.page-id-1155 div[style*="linear-gradient(135deg, #667eea"],
    body.page-id-1155 div[style*="linear-gradient(135deg,#667eea"],
    body.page-id-1155 div[style*="#667eea"],
    body.page-id-1155 div[style*="#764ba2"] {
        display: block !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin: 20px 10px !important;
        float: none !important;
        position: static !important;
        clear: both !important;
    }

    /* Ensure Immigration Case Management title is a block */
    body.page-id-1155 h3:first-of-type,
    body.page-id-1155 .elementor-heading-title:contains("Immigration Case Management"),
    body.page-id-1155 .elementor-widget:has(h3) {
        display: block !important;
        width: 100% !important;
        margin-bottom: 20px !important;
        clear: both !important;
    }

    /* Force vertical stacking with flexbox as fallback */
    body.page-id-1155 .elementor-section > .elementor-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.page-id-1155 .elementor-container > .elementor-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.page-id-1155 .elementor-row > .elementor-column {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Remove any inline styles that might cause side-by-side layout */
    body.page-id-1155 .elementor-inner-section .elementor-container {
        flex-direction: column !important;
    }

    /* Animated logo container */
    body.page-id-1155 #lottie-logo,
    body.page-id-1155 .logo-container {
        display: block !important;
        margin: 0 auto 20px !important;
        max-width: 200px !important;
    }

    /* Fix the order - Immigration Case Management should be first */
    body.page-id-1155 .elementor-section:first-child {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Welcome message styling */
    body.page-id-1155 h1 {
        text-align: center !important;
        padding: 15px !important;
        margin: 10px 0 !important;
        font-size: 22px !important;
        word-wrap: break-word !important;
        display: block !important;
        clear: both !important;
    }

    /* Dashboard text */
    body.page-id-1155 h2 {
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto 15px !important;
        font-size: 18px !important;
    }

    /* Immigration Case Management title */
    body.page-id-1155 h3 {
        text-align: center !important;
        width: 100% !important;
        display: block !important;
        margin: 0 0 20px 0 !important;
        font-size: 20px !important;
        padding: 10px !important;
        background: #f8f9fa !important;
        border-radius: 5px !important;
    }

    /* Logout button */
    body.page-id-1155 a[href*="logout"] {
        display: block !important;
        width: auto !important;
        max-width: 200px !important;
        text-align: center !important;
        margin: 15px auto !important;
        padding: 10px 20px !important;
        background: #dc3545 !important;
        color: white !important;
        border-radius: 5px !important;
        text-decoration: none !important;
    }

    /* Subscription box container */
    body.page-id-1155 .elementor-widget-container {
        overflow: visible !important;
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* View Plans and Manage Subscription buttons */
    body.page-id-1155 [href*="plan"],
    body.page-id-1155 [href*="pricing"],
    body.page-id-1155 [href*="billing"],
    body.page-id-1155 .manage-subscription-btn {
        display: block !important;
        width: 100% !important;
        margin: 10px 0 !important;
        text-align: center !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    /* Unique application URL */
    body.page-id-1155 [class*="application-link"],
    body.page-id-1155 [class*="unique-link"] {
        word-break: break-all !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
        padding: 10px !important;
        background: #f5f5f5 !important;
        border-radius: 5px !important;
        display: block !important;
        overflow-wrap: break-word !important;
    }

    /* Table mobile card layout */
    body.page-id-1155 table {
        border: none !important;
        background: transparent !important;
    }

    body.page-id-1155 thead {
        display: none !important;
    }

    body.page-id-1155 tbody,
    body.page-id-1155 tr,
    body.page-id-1155 td {
        display: block !important;
        width: 100% !important;
    }

    body.page-id-1155 tr {
        margin-bottom: 15px !important;
        background: white !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        padding: 15px !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }

    body.page-id-1155 td {
        text-align: left !important;
        padding: 8px 0 !important;
        border: none !important;
        position: relative !important;
        padding-left: 35% !important;
    }

    body.page-id-1155 td::before {
        content: attr(data-label);
        position: absolute !important;
        left: 0 !important;
        width: 30% !important;
        font-weight: bold !important;
        text-align: left !important;
        padding-left: 10px !important;
    }

    /* Application number styling */
    body.page-id-1155 td:first-child {
        background: #9B59D0 !important;
        color: white !important;
        padding: 10px !important;
        margin: -15px -15px 10px -15px !important;
        border-radius: 8px 8px 0 0 !important;
        text-align: center !important;
        font-weight: bold !important;
    }

    body.page-id-1155 td:first-child::before {
        content: "Application #" !important;
        position: relative !important;
        padding: 0 !important;
        width: auto !important;
    }

    /* Actions column */
    body.page-id-1155 td:last-child {
        text-align: center !important;
        padding-left: 0 !important;
        margin-top: 10px !important;
        padding-top: 15px !important;
        border-top: 1px solid #e0e0e0 !important;
    }

    body.page-id-1155 td:last-child::before {
        display: none !important;
    }

    /* View Details button */
    body.page-id-1155 td:last-child a,
    body.page-id-1155 td:last-child button {
        display: inline-block !important;
        padding: 8px 20px !important;
        background: #9B59D0 !important;
        color: white !important;
        text-decoration: none !important;
        border-radius: 5px !important;
        font-size: 14px !important;
    }

    /* Remove any position absolute/fixed elements */
    body.page-id-1155 .elementor-absolute,
    body.page-id-1155 .elementor-fixed {
        position: static !important;
    }

    /* Ensure proper spacing between elements */
    body.page-id-1155 > * {
        margin-bottom: 20px !important;
    }

    /* Container padding */
    body.page-id-1155 {
        padding: 10px !important;
        overflow-x: hidden !important;
    }

    /* Ensure no horizontal scroll */
    body.page-id-1155 .elementor-section,
    body.page-id-1155 .elementor-container,
    body.page-id-1155 .elementor-row,
    body.page-id-1155 .elementor-column {
        padding-left: 10px !important;
        padding-right: 10px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Force inline styles to be overridden */
    body.page-id-1155 [style*="display: flex"] {
        display: block !important;
    }

    body.page-id-1155 [style*="flex-direction: row"] {
        flex-direction: column !important;
    }
}

/* Ensure desktop version remains completely unchanged */
@media only screen and (min-width: 768px) {
    body.page-id-1155 * {
        /* Desktop styles remain untouched */
    }
}