/**
 * Mobile layout rules and all modal styling.
 *
 * Split from public/css/cashier.css (2,091 lines). Cascade order matters:
 * load these in the numbered order, exactly as the original file was ordered.
 */

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 740px) {
    body {
        padding: 8px;
    }

    .container {
        border-radius: 12px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.4em;
    }

    .seating-container {
        padding: 10px;
    }

    .seat {
        width: 16px;
        height: 16px;
        margin: 1px;
        border-radius: 3px;
        font-size: 8px;
    }

    .row {
        margin-bottom: 2px;
    }

    .row-label {
        width: 20px;
        font-size: 0.75em;
        margin: 2px;
    }

    .gap {
        width: 16px;
    }

    .section-title {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .main-seating {
        margin-bottom: 10px;
        margin-top: 5px;
    }

    .legend {
        gap: 12px;
        margin: 15px 0;
        padding: 0 5px;
    }

    .legend-item {
        font-size: 0.75em;
        gap: 4px;
    }

    .legend-seat {
        width: 14px;
        height: 14px;
    }

    .action-panel {
        margin: 15px 10px;
        padding: 15px;
    }

    .selected-seats {
        font-size: 0.9em;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        padding: 12px 25px;
        font-size: 1em;
        width: 100%;
        max-width: 200px;
    }
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
    text-align: center;
    color: #2c3e50;
}

.modal-body p {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    line-height: 1.5;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 1px solid #dee2e6;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 120px;
}

.modal-btn.cancel {
    background: #6c757d;
    color: white;
}

.modal-btn.cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.modal-btn.delete {
    background: #dc3545;
    color: white;
}

.modal-btn.delete:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* "Reload from production". An outline rather than a filled button: it sits beside
   Update, and two solid buttons in a footer read as two ways of finishing the form -
   this one writes on its own and leaves the form open. */
.modal-btn.reload-production {
    background: transparent;
    color: #495057;
    border: 1px solid #ced4da;
    /* Wider than the 120px the footer's buttons cap at - the label is a phrase, not a
       verb, and it wraps to two lines at that width. */
    max-width: none;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.modal-btn.reload-production:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Holds the footer's two closing buttons over to the right, away from the action that
   is not a way of closing it. */
.modal-footer-spacer {
    flex: 1;
}

/* The hover-for-preview note above the poster pickers. */
.new-event-modal .field-hint {
    font-size: 0.82em;
    color: #6c757d;
    margin: 0 0 8px;
}

.new-event-modal .field-hint i {
    margin-right: 5px;
}

/* ===== OPERATOR COMMENT MODAL =====
   The base .modal-header is the delete modal's red, which would read as a warning on
   what is an ordinary step in a sale, so this one takes the house gradient. */
.comment-modal .modal-header {
    background: var(--primary-gradient);
}

.comment-modal .modal-body {
    text-align: left;
}

.comment-modal textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    color: var(--text-primary);
    resize: vertical;
}

.comment-modal textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.comment-modal-error {
    margin-top: 8px;
    color: var(--error-color);
    font-size: 0.9em;
    font-weight: 600;
}

.modal-btn.confirm {
    background: #667eea;
    color: white;
}

.modal-btn.confirm:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* ===== NEW EVENT MODAL STYLES ===== */
/**
 * The event modals.
 *
 * Wider than they were: the form now shows the production's cast and staff in two
 * columns, which 600px could not hold without wrapping every name.
 *
 * Styling follows the hall plan and production screens - same 15px radius, same button
 * shapes, same muted secondary text - so the three admin surfaces read as one product.
 */
.new-event-modal .modal-content {
    max-width: 860px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 15px;
}

.new-event-modal .modal-body {
    padding: 22px;
}

/* ===== LINE-UP ===== */
.lineup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
}

.lineup-column > label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9em;
    color: #2c3e50;
}

.lineup-column > label i {
    color: #6c757d;
    margin-right: 5px;
}

.lineup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lineup-empty {
    font-size: 0.84em;
    color: #6c757d;
    font-style: italic;
}

/* Every group drawn here is a part two or more people share - the only kind the form
   receives - so the tint that used to mark those is simply the group's own look. */
.lineup-group {
    background: #f7fbff;
    border: 1px solid #cfe2ff;
    border-radius: 8px;
    padding: 8px 10px;
}

.lineup-role {
    font-size: 0.76em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 5px;
}

.lineup-people {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lineup-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9em;
}

/* Struck through rather than hidden: the cashier needs to see that somebody was taken
   out, and be able to put them back. */
.lineup-person.is-blocked .lineup-name {
    text-decoration: line-through;
    color: #adb5bd;
}

.lineup-block {
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 50%;
    font-size: 0.85em;
    line-height: 1;
    transition: all 0.2s ease;
}

.lineup-block:hover {
    background: #f8d7da;
    color: #dc3545;
}

.lineup-person.is-blocked .lineup-block:hover {
    background: #d4edda;
    color: #28a745;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}
.rule-field select {width: auto;}

.form-group input[readonly] {
    background: #f8f9fa;
    cursor: pointer;
}

.form-group input[readonly]:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.form-group input[type="time"] {
    font-family: monospace;
}

.form-group input[type="time"]::-webkit-datetime-edit-hour-field,
.form-group input[type="time"]::-webkit-datetime-edit-minute-field {
    font-family: monospace;
}

.form-group input[type="time"] {
    color-scheme: dark light;
}

.form-group input[type="time"]::-webkit-datetime-edit-ampm-field {
    display: none;
}

.form-group input[type="time"]::-webkit-calendar-picker-indicator {
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.time-select {
    width: 60px;
    padding: 8px 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.time-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.time-separator {
    font-weight: bold;
    color: #666;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.price-tiers-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

/* Holds one input per tier the chosen mapping defines, so its width is not fixed. */
.price-tier-fields {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}

.price-tier-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 75px;
}

.price-tier-mapping-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 170px;
}

.price-tier-mapping-input select {
    padding: 7px;
}

.price-tier-input label {
    font-size: 0.9em;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
}

.price-tier-input input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.price-tier-input input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.price-tier-mapping-input select[disabled] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    cursor: pointer;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
    color: #6c757d;
    z-index: 2;
    position: relative;
}

.file-input-label:hover {
    border-color: #007bff;
    background: #e9ecef;
    color: #007bff;
}

.file-input-label i {
    margin-right: 8px;
    font-size: 1.2em;
}

.file-name {
    margin-top: 5px;
    font-size: 0.85em;
    color: #6c757d;
    word-break: break-all;
}

.language-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.language-tab {
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #6c757d;
}

.language-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.language-content {
    display: none;
}

.language-content.active {
    display: block;
}


/* ===== MODAL HEADER VARIATIONS ===== */
#newEventModal .modal-header {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

#editEventModal .modal-header {
    background: linear-gradient(135deg, #e67e22, #f39c12);
}

#discountModal .modal-header {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.add-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    margin-left: auto;
}

.add-btn:hover {
    background: #218838;
}

.promocode-field, .rule-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.promocode-field input, .rule-field input, .rule-field select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: auto;
}

.promocode-field input:first-child {
    flex: 2;
}

.rule-field select {
    flex: 1;
    min-width: 120px;
}

.promocode-field input:last-of-type, .rule-field input:last-of-type {
    flex: 1;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.remove-btn:hover {
    background: #c82333;
}

.partner-discount-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.partner-discount-field select,
.partner-discount-field input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.partner-discount-field select {
    flex: 2;
}

.partner-discount-field input {
    flex: 1;
}
