/* app.css */
:root { --primary:#0ea5e9; --primary-color:var(--primary); --primary-ink:#0f172a; }

/* Grid Styles */
#shift-grid-wrap, #summary-table-wrap {
    overflow-x: auto;
}

#shift-grid, #summary-table, #staff-table, #shift-symbols-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

#shift-grid th, #shift-grid td,
#summary-table th, #summary-table td,
#staff-table th, #staff-table td,
#shift-symbols-table th, #shift-symbols-table td {
    border: 1px solid #ccc;
    padding: 4px 8px;
    text-align: center;
    font-size: 14px;
}

#shift-grid thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 2;
}

#shift-grid tbody th, #summary-table tbody th {
    position: sticky;
    left: 0;
    background-color: #f8f9fa;
    z-index: 1;
    min-width: 100px;
    text-align: left;
}

#shift-grid .day-header {
    min-width: 50px;
}

#shift-grid .weekend-sat {
    color: #007bff;
    background-color: #e9f5ff;
}

#shift-grid .weekend-sun {
    color: #dc3545;
    background-color: #fff0f1;
}

#shift-grid .holiday {
    color: #dc3545;
    background-color: #fff0f1;
}

#shift-grid .staff-cell {
    cursor: pointer;
    min-width: 50px;
}

#shift-grid .staff-cell:hover {
    background-color: #e9ecef;
}

#shift-grid .required-people-input {
    width: 40px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#shift-grid .status-ok { background-color: #d4edda; }
#shift-grid .status-short { background-color: #f8d7da; }
#shift-grid .status-over { background-color: #fff3cd; }

#summary-table .warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Staff & Symbol tables */
#staff-table input[type="text"],
#staff-table input[type="number"],
#staff-table input[type="color"],
#shift-symbols-table input[type="text"],
#shift-symbols-table input[type="number"] {
    width: 100%;
    max-width: 120px;
    box-sizing: border-box;
}
#staff-table .ng-days-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
}
#staff-table .ng-days-wrap label {
    display: flex;
    align-items: center;
    cursor: pointer;
}


/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 34px;
    transition: background-color 0.2s;
    cursor: pointer;
}
.toggle-switch:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}
input:checked + .toggle-switch {
    background-color: #28a745;
}
input:checked + .toggle-switch:before {
    transform: translateX(20px);
}
#hope-mode-toggle {
    display: none;
}
label[for="hope-mode-toggle"] {
    margin-right: 8px;
}
.row > label[for="hope-mode-toggle"] {
    display: flex;
    align-items: center;
}


/* Context Menu */
#context-menu {
    padding: 10px;
    min-width: 150px;
}
#context-menu .list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}
#context-menu .list-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
#context-menu .list-item:last-child {
    border-bottom: none;
}
#context-menu .list-item:hover {
    background-color: #f0f0f0;
}
#context-menu .list-item.danger {
    color: #dc3545;
}

/* Other */
.hidden {
    display: none !important;
}

input[type="month"] {
    min-width: 150px;
}

/* Print Styles */
@media print {
    .no-print,
    .app-header,
    .app-footer,
    .card:not(:nth-of-type(4)), /* Print only the shift grid card */
    .card h2 + .row, /* Hide settings inside cards */
    .btn,
    .toggle-switch,
    label[for="hope-mode-toggle"],
    #staff-controls,
    #add-symbol-btn,
    .card h2 ~ .btn-row,
    .card h2 ~ div[class*="-lock"],
    div.card:nth-child(6), /* Hide tools card */
    div.card:nth-child(7) /* Hide data management card */
     {
        display: none !important;
    }

    body, .container {
        margin: 0;
        padding: 0;
    }
    
    .card {
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        break-inside: avoid;
    }
    
    @page {
        size: A4 landscape;
        margin: 15mm;
    }

    #shift-grid-wrap {
        overflow: visible;
    }
    
    #shift-grid, #summary-table {
        font-size: 10px;
    }
     #shift-grid th, #shift-grid td, #summary-table th, #summary-table td {
        padding: 2px 4px;
    }

    #shift-grid thead th, #shift-grid tbody th, #summary-table tbody th {
        position: static;
    }

    /* Add title for printing */
    #shift-grid-wrap::before {
        content: attr(data-print-title);
        display: block;
        font-size: 18px;
        font-weight: bold;
        text-align: center;
        margin-bottom: 10px;
    }

}
