@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Force modern, clean Poppins typography on all elements, overriding system defaults/fallbacks like Calibri on mobile */
* {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/*
  This CSS overrides and hides elements injected by free hosting providers (such as Somee.com).
*/

/* Hide any direct div child of body that contains fixed positioning or very high z-index (commonly used by somee.com for banners) */
body > div[style*="z-index"],
body > div[style*="position: fixed"],
body > div[style*="position:fixed"],
body > div[style*="opacity: 0.99"],
body > div[style*="opacity:0.99"],
body > div[style*="z-index: 2147483647"],
body > div[style*="z-index:2147483647"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Hide any center element that is a direct child of body (commonly contains Web hosting by Somee.com link) */
body > center,
body > div > center,
center a[href*="somee.com"],
a[href*="somee.com"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Hide somee's script error/ad elements and host-provided frames */
iframe[src*="somee"],
div[id*="somee"],
div[class*="somee"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Override any potential height adjustments or spacers injected at the bottom of the page */
div[style*="height: 65px"],
div[style*="height:65px"] {
    display: none !important;
    height: 0 !important;
}

/* --- GLOBAL MOBILE RESPONSIVENESS OVERRIDES --- */

/* Reset/Prevent HTML and body horizontal overflow page-wide */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Prevent containers and forms from spilling out */
    .container, .login-container, .wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
    
    /* Make tables and GridViews responsive via horizontal scrolling */
    table, 
    .results-table, 
    .questions-table, 
    .grid-view,
    form table,
    main table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box !important;
    }

    /* Stack buttons inside nav-buttons or action containers neatly */
    .nav-buttons, .button-container, .form-actions, .action-buttons-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        gap: 12px !important;
        margin: 15px 0 !important;
        box-sizing: border-box !important;
    }

    /* Standardize button dimensions and width limits on mobile */
    .nav-buttons .btn,
    .nav-buttons input[type="submit"],
    .button-container .btn,
    .button-container input[type="submit"],
    .form-actions .btn,
    .form-actions input[type="submit"],
    .action-buttons-container .btn,
    .action-buttons-container input[type="submit"],
    input[type="submit"].btn,
    button.btn {
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Prevent form input controls, selects, and textareas from overflowing */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Sidebar and layout responsiveness for admin portal on mobile */
    .admin-layout {
        flex-direction: column !important;
        min-height: auto !important;
    }
    
    .sidebar {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
        border-bottom: 1px solid #1e293b !important;
    }
    
    .sidebar-brand {
        padding: 15px !important;
    }
    
    .sidebar-menu {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding: 10px !important;
    }
    
    .sidebar-menu li {
        margin: 5px !important;
        flex-grow: 1 !important;
        text-align: center !important;
    }
    
    .sidebar-menu li a {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }
    
    .sidebar-footer {
        padding: 10px !important;
        border-top: none !important;
    }
    
    .btn-logout-sidebar {
        padding: 8px !important;
        font-size: 14px !important;
        max-width: 200px !important;
        margin: 0 auto !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }
}
