/* Mobile-Responsive CSS for Contractor Portal */
/* Add this to all pages with: <link rel="stylesheet" href="/static/mobile-responsive.css"> */

/* Viewport meta tag should be in HTML head:
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
*/

/* Base responsive settings */
* {
    box-sizing: border-box;
}

/* Mobile-first approach */
@media screen and (max-width: 768px) {
    /* Body adjustments - LARGER text for field workers */
    body {
        padding: 10px !important;
        font-size: 18px !important;
        overflow-x: hidden;
        line-height: 1.5 !important;
    }

    /* Container adjustments */
    .container {
        max-width: 100% !important;
        padding: 15px !important;
        margin: 0 !important;
    }

    /* Headings - MUCH LARGER for readability */
    h1 {
        font-size: 28px !important;
        font-weight: bold !important;
    }

    h2 {
        font-size: 24px !important;
        font-weight: bold !important;
    }

    h3 {
        font-size: 20px !important;
        font-weight: bold !important;
    }

    h4 {
        font-size: 18px !important;
        font-weight: bold !important;
    }

    /* Buttons - BIGGER for easy tapping */
    button, .button, input[type="submit"] {
        width: 100% !important;
        padding: 18px 12px !important;
        margin: 10px 0 !important;
        font-size: 20px !important;
        font-weight: bold !important;
        display: block !important;
        min-height: 56px !important;
    }

    /* Forms - LARGER for easy input */
    input, select, textarea {
        width: 100% !important;
        padding: 16px !important;
        margin: 8px 0 !important;
        font-size: 18px !important;
        min-height: 52px !important;
    }

    label {
        font-size: 18px !important;
        font-weight: bold !important;
        display: block !important;
        margin-bottom: 5px !important;
    }

    /* Tables - make them scrollable with larger text */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    th, td {
        padding: 12px 8px !important;
        font-size: 16px !important;
    }

    th {
        font-weight: bold !important;
    }

    /* Sections */
    .section {
        margin-bottom: 15px !important;
    }

    /* Property Board specific - LARGER for field use */
    .board-container {
        padding: 10px 5px !important;
    }

    .property-column {
        min-width: 280px !important;
        max-width: 280px !important;
        padding: 12px !important;
    }

    .property-name {
        font-size: 18px !important;
        font-weight: bold !important;
    }

    .property-address {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }

    /* Header adjustments */
    .header {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 10px !important;
    }

    .header h1 {
        margin-bottom: 10px !important;
    }

    .back-btn {
        width: 100% !important;
    }

    /* Navigation links */
    a.button {
        display: block !important;
        margin: 8px 0 !important;
        width: 100% !important;
        text-align: center;
    }

    /* Password section */
    .password-section {
        max-width: 100% !important;
        padding: 15px !important;
        margin: 20px 0 !important;
    }

    /* Reports and admin sections */
    .report-form, .admin-form {
        padding: 10px !important;
    }

    /* Contractor cards */
    .contractor-card {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    /* Remove excessive margins on mobile */
    .section > * {
        margin: 5px 0 !important;
    }

    /* Make inline buttons stack vertically */
    .button-group {
        display: flex;
        flex-direction: column;
    }

    /* Adjust log entries for mobile - LARGER */
    .log-entry {
        padding: 15px !important;
        margin: 10px 0 !important;
        font-size: 17px !important;
    }

    /* Product management tables */
    .product-table {
        font-size: 15px !important;
    }

    /* Status indicators - make them prominent */
    .status {
        font-size: 17px !important;
        font-weight: bold !important;
        padding: 8px 12px !important;
    }

    /* Property cards and lists */
    .property-card, .property-item {
        padding: 15px !important;
        margin: 10px 0 !important;
        font-size: 17px !important;
    }

    /* Time and date displays */
    .time-display, .date-display {
        font-size: 19px !important;
        font-weight: bold !important;
    }
}

/* Tablet adjustments (768px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 15px;
    }

    .container {
        max-width: 90%;
    }

    button, .button {
        width: auto;
        min-width: 150px;
    }

    .property-column {
        min-width: 260px;
        max-width: 260px;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets - MINIMUM 56px for easy tapping */
    button, .button, a, input[type="submit"], input[type="button"] {
        min-height: 56px !important;
        padding: 18px !important;
        font-size: 20px !important;
    }

    /* Better spacing for touch */
    input, select, textarea {
        min-height: 52px !important;
        font-size: 18px !important;
    }

    /* Remove hover effects on touch devices */
    button:hover, .button:hover {
        background-color: inherit;
    }

    /* Larger clickable areas for links */
    a {
        padding: 12px 8px !important;
        display: inline-block;
    }
}

/* Landscape mode on mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    .container {
        padding: 10px;
    }

    h1, h2, h3 {
        margin: 5px 0;
    }
}

/* Print styles */
@media print {
    .back-btn, .button, button {
        display: none !important;
    }

    body {
        background-color: white !important;
        color: black !important;
    }

    table {
        width: 100%;
        font-size: 10pt;
    }
}
