/*
 * Powerful Mobile Responsive Fixes
 * Load this stylesheet LAST to ensure its rules take priority.
*/

/* This media query targets all screens up to 768px wide (phones and small tablets) */
@media (max-width: 768px) {

    /* --- GLOBAL LAYOUT & TYPOGRAPHY --- */

    /* Force a more compact layout by reducing padding on main containers */
    body, .main-content, .page-content-container, .container, .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Adjust base font size for better readability on small screens */
    html {
        font-size: 15px; /* This makes 'rem' units slightly smaller */
    }

    /* Reduce header sizes to prevent them from taking up too much space */
    h1, .h1 { font-size: 2rem !important; }
    h2, .h2 { font-size: 1.6rem !important; }
    h3, .h3 { font-size: 1.3rem !important; }
    h4, .h4 { font-size: 1.1rem !important; }

    /* --- DASHBOARD & CARDS (from your screenshot) --- */

    /* General card styling for a tighter look */
    .card, .info-card, .welcome-card, .deposit-card, .withdrawal-section {
        padding: 1rem !important;
    }

    /* Make the welcome card stack vertically */
    .welcome-card {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .welcome-card .welcome-text {
        margin-bottom: 1rem !important;
    }

    /* Ensure buttons inside cards are full-width for easy tapping */
    .welcome-card .btn, .card .btn {
        width: 100%;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    
    /* Target the specific summary cards on the dashboard */
    .info-card, .stat-card {
        flex-direction: row; /* Ensure icon and text are side-by-side */
        align-items: center;
    }
    .info-card .card-value, .stat-card .value {
        font-size: 1.5rem !important;
    }


    /* --- FORMS (Login, Register, Deposit, Withdrawal) --- */

    /* Ensure form grids stack vertically */
    .form-grid, .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-column, .form-group {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    /* Adjust auth form for mobile */
    .auth-form-container, .auth-container {
        width: 100% !important;
        padding: 1.5rem !important;
        margin: 1rem 0;
    }
    
    /* --- TABLES --- */

    /* Make tables scroll horizontally if they are too wide */
    .table-responsive, table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }


    /* --- NAVIGATION & HEADER --- */

    /* Example: Hide a desktop-only user name and show a mobile one */
    .desktop-username {
        display: none !important;
    }
    .mobile-username {
        display: block !important;
    }

    /* Reduce padding in the header to save vertical space */
    .page-header {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* --- UTILITY --- */
    
    /* A helper class to hide elements only on mobile */
    .hide-on-mobile {
        display: none !important;
    }
}
