/* ---------------------------------
   Schedule Module Styles
--------------------------------- */

/* =========================
   Navigation
========================= */

.schedule-navigation {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 24px;
    font-size: 16px;
}

.schedule-navigation a {
    text-decoration: none;
    font-weight: 500;
    margin: 0 12px;
}

.schedule-navigation strong {
    font-size: 18px;
}

.nav-arrow {
    font-size: 18px;
    font-weight: bold;
}

/* =========================
   Board Layout
========================= */

.schedule-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.schedule-column {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e2e2e2;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    max-height: 600px;
    overflow-y: auto;
}

.schedule-column h4 {
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 16px;
    font-weight: 600;
}

.schedule-column:hover{
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

/* =========================
   Technician Header
========================= */

.tech-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    gap: 8px;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    background: #fafafa;
    z-index: 5;
}

.tech-job-count {
    font-size:12px;
    color:#666;
    margin-left:6px;
}

/* =========================
   Cards
========================= */

.schedule-card {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 10px;
}

.schedule-card strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.schedule-customer {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    margin-bottom: 6px;
}

.schedule-time {
    font-weight: 600;
    margin-right: 6px;
    color: #444;
}

.no-jobs{
    color:#9aa0a6;
    font-size:13px;
    font-style:italic;
}

/* =========================
   Action Buttons
========================= */

.schedule-actions{
    margin-top:1px;
    font-size:12px;

    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:0px 6px;
}

.schedule-actions a{
    text-decoration:none;
    padding:0px 4px;
    border-radius:4px;
    text-align:center;
    font-weight:500;
    border:1px solid transparent;
    white-space:nowrap;
}

.schedule-actions a:hover{
    text-decoration:underline;
}

@media (max-width:600px){
    .schedule-actions{
        grid-template-columns:repeat(2,1fr);
    }
}

/* =========================
   Date Display
========================= */

.date-short {
    display: none;
}

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

@media (max-width: 600px) {

    .schedule-board {
        grid-template-columns: repeat(2, 1fr);
    }

    .date-full {
        display: none;
    }

    .date-short {
        display: inline;
    }

    .nav-text {
        display: none;
    }

    .schedule-navigation {
        font-size: 14px;
    }

    .schedule-navigation a {
        margin: 0 6px;
        padding: 6px 8px;
    }

    .nav-arrow {
        font-size: 24px;
    }
}

/* =========================
   Modal Base
========================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0,0,0,0.35);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 1000;
}

.modal-box {
    background: #ffffff;
    padding: 24px;
    border-radius: 10px;

    width: 420px;
    max-width: 95%;

    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* =========================
   Modal Actions
========================= */

.modal-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-top:14px;
}

.modal-actions button,
.modal-actions a{
    padding:8px 12px;
    font-size:14px;
    min-height:38px;
    width:100%;
}

/* =========================
   Details Modal Layout
========================= */

.details-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:10px;
}

.details-header h3{
    margin:0;
    font-size:18px;
}

/* =========================
   Status Badge
========================= */

.status-badge{
    padding:4px 10px;
    border-radius:6px;
    font-size:12px;
    font-weight:600;
}

/* Status Colors */

.status-scheduled{
    background:#fff9db;
    color:#5c4f00;
    border:1px solid #e0d9a5;
}

.status-in_progress{
    background:#e7f1ff;
    color:#0b4ea2;
    border:1px solid #bcd4ff;
}

.status-completed{
    background:#e8f7ec;
    color:#1c6b38;
    border:1px solid #b8e2c3;
}

.status-cancelled{
    background:#f2f2f2;
    color:#555;
    border:1px solid #d6d6d6;
}

.status-rescheduled{
    background:#fff0e0;
    color:#8a4b08;
    border:1px solid #f2c9a5;
}

/* =========================
   Modal Grid
========================= */

.details-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px 18px;
    margin-top:10px;
}

.details-item label{
    font-size:12px;
    font-weight:600;
    color:#555;
    display:block;
    margin-bottom:2px;
}

.details-item div{
    font-size:14px;
    line-height:1.3;
}

/* Complaint full width */

.details-complaint{
    grid-column:1 / -1;
    background:#f7f7f7;
    padding:6px 10px;
    border-radius:6px;
    margin-top:4px;
    font-size:14px;
    line-height:1.3;
}

.details-complaint label{
    display:block;
    font-size:12px;
    font-weight:600;
    margin-bottom:2px;
}

/* Address formatting */

#detailsAddress,
#detailsContact{
    white-space:pre-line;
}

/* =========================
   Admin Tools
========================= */

.admin-tools{
    margin-top:14px;
    padding-top:10px;
    border-top:1px solid #e5e5e5;
    text-align:center;
}

.admin-tools h4{
    font-size:16px;
    font-weight:600;
    color:#666;
    margin-bottom:8px;
}

.admin-buttons{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:6px;
}

.admin-buttons button{
    font-size:13px;
    padding:6px 12px;
    border-radius:4px;
    border:1px solid var(--button-color);
    background:var(--button-color);
    color:var(--button-text-color);
    cursor:pointer;
}

.admin-buttons button:hover{
    background:var(--button-hover-color);
}


/* =========================
   Queue Preview
========================= */

.queue-preview{
    margin-top:12px;
    padding-top:10px;
    border-top:1px solid #e5e5e5;
    text-align:center;
}

.queue-item{
    font-size:13px;
    color:#888;
    margin:6px 0;
}

.queue-current{
    font-size:14px;
    font-weight:600;
    padding:4px 10px;
    border-radius:6px;
    background:#f3f6ff;
}

.queue-btn{
    font-size:12px;
    padding:4px 8px;
    border:1px solid var(--button-color);
    border-radius:4px;
    background:var(--button-color);
    cursor:pointer;
    text-decoration:none;
    color:var(--button-text-color);
}

.queue-btn:hover{
    background:var(--button-hover-color);
}

/* =========================
   Queue Row Layout
========================= */

.queue-row{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:12px;
    margin:10px 0;
}




/* =========================
   Card Status Backgrounds
========================= */

.schedule-card.status-scheduled { background:#fff9db; }
.schedule-card.status-in_progress { background:#e7f1ff; }
.schedule-card.status-completed { background:#e8f7ec; }
.schedule-card.status-cancelled {
    background:#e9e9e9;
    border-color:#999;
}
.schedule-card.status-rescheduled { background:#fff0e0; }

/* =========================
   Schedule Legend
========================= */

.schedule-legend{
    display:flex;
    justify-content:center;
    gap:20px;
    margin:18px auto 25px auto;
    padding:10px 18px;
    border:1px solid black;
    border-radius:6px;
    background:transparent;
    width:fit-content;
}

.legend-item{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
    font-weight:500;
}

.legend-box{
    width:20px;
    height:20px;
    border-radius:4px;
    border:1px solid #444;
}

.legend-scheduled { background:#fff3a3; }
.legend-in_progress { background:#c9e1ff; }
.legend-completed { background:#bfe8c9; }
.legend-cancelled { background:#d0d0d0; }
.legend-rescheduled { background:#ffd6a6; }
.legend-on_hold { background-color: #dc2626; }

/* =========================
   Toggle and Week View
========================= */
.board-mode-toggle{
    display:flex;
    justify-content:center;   /* center buttons */
    align-items:center;
    gap:6px;
    margin:12px 0 16px 0;
}

.toggle-btn{
    padding:6px 14px;
    border-radius:6px;
    border:1px solid var(--button-color);
    text-decoration:none;
    background:var(--button-color);
    font-size:13px;
    color:var(--button-text-color);
    min-width:110px;
    text-align:center;
}

.toggle-btn:hover{
    background:var(--button-hover-color);
}

.toggle-btn.active{
    background:var(--button-hover-color);
    color:var(--button-text-color);
    border-color:var(--button-hover-color);
}

.week-btn{
    border-right:1px solid rgba(0,0,0,0.15);
    padding-right:12px;
    margin-right:6px;
}


/* =========================
   Mobile Legend Layout
========================= */

@media (max-width: 600px) {

    .schedule-legend {
        display:grid;
        grid-template-columns:repeat(3,1fr);
        max-width:340px;
        margin:12px auto 18px auto;
        gap:10px 18px;
        justify-items:start;
    }

    .legend-item{
        gap:6px;
        font-size:13px;
    }

    .legend-box{
        width:16px;
        height:16px;
    }

}


/* =========================
   Week View
========================= */
.schedule-week-table{
    width:100%;
    border-collapse:collapse;
    margin-top:15px;
}

.schedule-week-table th,
.schedule-week-table td{
    border:1px solid #e5e7eb;
    padding:8px;
    text-align:center;
}

.schedule-week-table th{
    background:#f3f4f6;
}

.week-count{
    font-weight:bold;
    color:#2563eb;
    cursor:pointer;
}


/* =========================
   Mobile Modal Layout
========================= */

@media (max-width:600px){

    .modal-box{
        padding:18px;
        width:95%;
    }

    .details-grid{
        gap:8px 12px;
    }

}

/* =========================
   ON HOLD STATUS
========================= */



/* Card look */
.status-on_hold{
    background-color: #fef2f2;   /* very light red */
    border: 2px dashed #dc2626;  /* strong red border */
    color: #7f1d1d;              /* darker readable text */
}

.on-hold-reason{
    font-size: 12px;
    color: #92400e; /* darker brown/orange */
    margin-top: 6px;
    font-style: italic;
}