/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
}

/* ===== HEADER ===== */

.site-header {
    background-color: #2c3e50;
    padding: 10px 15px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

main img {
    max-width: 100%;
    height: auto;
}

.header-content img.logo {
    width: 35px !important;
    height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.header-content h1 {
    color: white;
    font-size: 2.8rem;
    margin: 0;
}

.logo {
    width: 35px;
    height: 35px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ===== NAVIGATION ===== */

.site-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    background-color: #34495e;
}

.site-nav a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: bold;
}

.site-nav a:hover {
    background-color: #1f4e79;
}

/* ===== MOBILE ADJUSTMENTS ===== */

@media (max-width: 600px) {
    .header-content img.logo {
        width: 28px !important;
        height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
    }
    
    .site-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav a {
        width: 100%;
        text-align: center;
        margin: 0;
        border-top: 1px solid rgba(255,255,255,0.15);
    }
}

/* Header Styles */
header:not(.site-header) {
    background-color: #2c3e50;
    padding: 40px 0;
}

header:not(.site-header) h1 {
    font-size: 3em;
}
    

nav a {
    color: white;
    text-decoration: none;
    font-size: 1.2em;
    margin: 0 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #ecf0f1;
}

/* Main Content Area */
main {
    padding: 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

main h2 {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 20px;
}

main p {
    font-size: 1.1em;
    color: #7f8c8d;
    line-height: 1.8;
}

/* Footer Styles */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    position: relative;
    bottom: 0;
    width: 100%;
}

footer p {
    margin: 0;
}

/* ===== Technician Form ===== */
.tech-form table {
    width: 100%;
    border-collapse: collapse;
}

.tech-form td {
    padding: 10px;
    vertical-align: top;
}

.tech-form input:not([type="radio"]),
.tech-form select,
.tech-form textarea {
    width: 100%;
    font-size: 18px;
    padding: 8px;
}

.tech-form textarea {
    resize: vertical;
}

.tech-form img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
}

.tech-buttons {
    grid-column: 1 / -1; /* span full width of grid */ 
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ===== Technician Assigned Offers Page Styles ===== */
.tao-offers-container {
    width: 100%;
    overflow-x: auto; /* fallback scroll for extremely small screens */
}


/* 11-column grid */
.tao-offers-grid-11 {
    display: grid;
    gap: 5px;

    grid-template-columns:
        50px          
        220px         
        150px         
        180px
        120px
        120px
        120px
        120px
        120px
        120px
        120px;

    min-width: 1500px;

    align-items: stretch;
}

/* 8-column grid */
.tao-offers-grid-8 {
    display: grid;
    gap: 5px;
    grid-template-columns: 50px 
        200px 
        minmax(0, 1fr)   /* 🔥 FIXED */
        120px 
        120px 
        120px 
        120px 
        120px;
    min-width: 900px;
    align-items: stretch;
}

/* 5-column grid */
.tao-offers-grid-5 {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(5, 1fr);
    min-width: 700px;
    align-items: stretch;
}

/* 4-column grid */
.tao-offers-grid-4 {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(4, 1fr);
    min-width: 700px;
    align-items: stretch;
}

/* Label cells */
.tao-label-cell {
    min-width: 0;                 /* 🔥 critical */
    padding: 5px 10px;
    border: 1px solid #ccc;
    text-align: center;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Header cells */
.tao-header-cell {
    font-weight: bold;
    background-color: #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

@media (max-width: 768px) {

    .changejobstatus-page .tao-label-cell {
        white-space: normal;        /* ✅ allow wrapping */
        word-break: break-word;     /* ✅ break long text */
        overflow-wrap: anywhere;    /* ✅ force wrap if needed */
        padding: 8px;
    }
    
    .readonly-grid {
        grid-template-columns: 1fr;
    }

    .readonly-label {
        text-align: left;
    }
    
    
    .tao-offers-grid-8 {
        grid-template-columns: 50px 200px 160px 120px 120px 120px 120px 120px;
        min-width: 950px;
    }

    .tao-offers-grid-5 {
        grid-template-columns: repeat(5, 1fr);
        min-width: 700px;
    }

    .tao-offers-grid-11 {
        min-width: 900px;  /* forces horizontal scroll */
    }


    .tao-header-cell {
        display: flex;  /* SHOW HEADERS ON MOBILE */
        font-size: 14px;
        text-align: center;
        background-color: #f0f0f0;
        position: sticky;
        top: 0;
        z-index: 2;
    }
}



.row {
    display: flex;
    flex-wrap: wrap; /* allow columns to wrap on small screens */
}

.column {
    flex: 1 1 12.5%; /* grows/shrinks, base width 12.5% */
    padding: 5px;
}



@media (max-width: 480px) {

    .column {
        flex: 1 1 100%; /* stack 1 per row on phones */
    }
}


/* ===== Read-Only Details Grid (Job Status Details) ===== */

.readonly-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px 16px;
    max-width: 900px;
    margin: 0 auto;
}

.readonly-label {
    font-weight: bold;
    background-color: #f4f6f8;
    padding: 10px;
    border-radius: 4px;
    text-align: right;
    color: #2c3e50;
}

.readonly-value {
    background-color: #ffffff;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #333;
}

/* Textarea inside read-only value */
.readonly-value textarea {
    width: 100%;
    font-size: 16px;
    resize: none;
    border: 1px solid #ccc;
    padding: 8px;
    background-color: #fafafa;
}

.readonly-section-title {
    grid-column: 1 / -1;   /* span all columns */
    font-weight: bold;
    text-align: center;
    padding: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    color: #2c3e50;
    margin-top: 10px;
}

/* ===== Mobile ===== */


/* Only applies to changejobstatus.jsp */
.changejobstatus-page {
    overflow-x: auto;  /* horizontal scroll */
    -webkit-overflow-scrolling: touch;
}

.changejobstatus-page .tao-offers-grid-8 {
    display: grid;
    grid-template-columns: 50px 200px 220px 120px 120px 120px 140px 120px;
    gap: 5px;
    min-width: 1000px;  /* force scroll on small screens */
}

.readonly-grid .evaluation {
    display: contents;
}

.button-group {
    display: flex;
    flex-wrap: wrap; /* allow wrapping on small screens */
    justify-content: center; /* center buttons horizontally */
    gap: 10px; /* horizontal and vertical spacing */
    margin-top: 10px; /* optional extra space above buttons */
}

.button-group button {
    flex: 1 1 140px; /* grow/shrink with screen, base width 140px */
    max-width: 160px;
    height: 45px;
}

/* ==== Honeypot field change to hide the field ==== */
.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==== To make look error messanges in JSP red ==== */
.error {
    color: red;
    font-size: 14px;
    margin-top: 4px;
}

/* This is to make the radio buttons appear on the same line as its description */
.field-cell label {
    display: inline-block;
    margin-right: 15px; /* spacing between options */
}

.tech-form input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0 6px 0 0;
    vertical-align: middle;
}

.radio-option label {
    display: inline-flex;
    align-items: center;
}

.filter-form {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.filter-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
    padding: 8px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.filter-form button {
    padding: 10px 18px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.filter-form button:hover {
    background-color: #0056b3;
}

/* This is to make look input tags disabled as if they were enabled */
.fake-enabled {
    background-color: white !important;
    color: black !important;
    opacity: 1 !important;
    cursor: default;
}

.locked-field {
    pointer-events: none;
}

.banner-container {
    clear: both;
    width: 100%;
    text-align: center;
    background-color: #f5f5f5;
    padding: 10px 0;
    margin-top: 15px;
}

.banner-image {
    display: block;
    width: 100%;
    max-width: 1200px;
    height: auto;
    border-radius: 12px;
    margin: 0 auto;   /* THIS centers it horizontally */
}

/* ===== HELP PAGE STYLES ===== */

.help-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.help-container p {
    color: #333333; /* dark gray / blackish */
}

.help-title {
    text-align: center;
    margin-bottom: 10px;
}

.help-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* 🔹 Card grid */
.help-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* 🔹 Cards */
.help-card {
    display: block;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    text-align: center;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.help-card:hover {
    background: #007bff;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 🔹 Divider */
.help-divider {
    margin: 30px 0;
}

/* 🔹 Sections */
.help-section {
    margin-bottom: 40px;
}

.help-section h2 {
    margin-bottom: 10px;
    color: #333;
}

/* 🔹 Smooth scrolling */
html {
    scroll-behavior: smooth;
}

.highlight {
    color: red;  /* or #ff0000, #e74c3c, etc. */
    font-weight: bold; 
}

.center-text {
    text-align: center;
}

.tao-label-cell a {
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tao-offers-grid-8 > div,
.tao-offers-grid-11 > div,
.tao-offers-grid-5 > div,
.tao-offers-grid-4 > div {
    min-width: 0;
}

.tao-label-cell {
    word-break: break-word;
    overflow-wrap: break-word; /* 👈 NOT anywhere */
}

/* ===== Technician History Responsive Fix ===== */


/* Prevent grid items from overflowing */
.readonly-grid > div {
    min-width: 0;
}

/* Desktop */
.readonly-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 12px 16px;
    width: 100%;
}

/* Labels */
.readonly-label {
    font-weight: bold;
    background-color: #f4f6f8;
    padding: 10px;
    border-radius: 4px;
    text-align: right;

    /* IMPORTANT */
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Values */
.readonly-value {
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;

    /* IMPORTANT */
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Inputs/selects/textareas */
.readonly-value select,
.readonly-value textarea {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
}

/* Mobile */
@media (max-width: 768px) {

    .readonly-grid {
        grid-template-columns: 1fr;
    }

    .readonly-label {
        text-align: left;
    }

    .readonly-section-title {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }

    .readonly-value textarea {
        width: 100%;
    }
}

/* ===== FINAL MOBILE FIX FOR TECHNICIAN HISTORY ===== */

@media screen and (max-width: 768px) {

    .readonly-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .readonly-label,
    .readonly-value,
    .readonly-section-title {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
    }

    .readonly-label {
        text-align: left !important;
    }

    .readonly-value select,
    .readonly-value textarea {
        width: 100% !important;
        max-width: 100% !important;
    }

    main {
        padding: 20px 10px !important;
    }

    h2 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        word-break: break-word;
    }
}

/* ===== MOBILE SAFE GRID STRUCTURE ===== */

.evaluation-block {
    display: grid;
    grid-template-columns: inherit;
    grid-column: 1 / -1;
    gap: 12px 16px;
}

/* Respect hidden attribute */
.evaluation-block[hidden] {
    display: none !important;
}

@media screen and (max-width: 768px) {

    .readonly-grid {
        grid-template-columns: 1fr !important;
    }

    .evaluation-block {
        grid-template-columns: 1fr !important;
    }

    .readonly-label,
    .readonly-value,
    .readonly-section-title {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
    }

    .readonly-label {
        text-align: left !important;
    }

    .readonly-value select,
    .readonly-value textarea {
        width: 100% !important;
        max-width: 100% !important;
    }

    h2 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
}