/**
 * Static classes, user info, checkboxes, toggles, stats and sales tables.
 *
 * 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.
 */

/* ===== STATIC STYLING CLASSES ===== */
.message-container {
    max-width: 700px;
    margin: 0 auto;
}

.no-event-message {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

.legend-available {
    background: var(--seat-status-available);
}

.legend-sold {
    background: var(--seat-status-sold);
}

.legend-reserved {
    background: var(--seat-status-reserved);
}

.legend-selected {
    background: var(--seat-status-selected);
}

.seats-text-bold {
    font-weight: bold;
}

.seats-details {
    margin-top: 5px;
    font-size: 0.9em;
    color: #FFF;
}

.delete-warning {
    color: var(--error-color);
    font-weight: bold;
    margin-top: 15px;
}

.date-picker-container {
    position: relative;
}

.date-picker-hidden {
    position: absolute;
    left: 0;
    top: calc(100% - 30px);
    visibility: hidden;
    pointer-events: none;
    z-index: 9999;
}

.btn-create {
    background: var(--success-color);
    color: white;
}

/* No house amber exists - the shared --warning-color (#ffc107) is a light yellow that
   cannot carry white text - so this one stays a literal. */
.btn-update {
    background: #f39c12;
    color: white;
}

.btn-inactive {
    background: #bdc3c7;
}

/* The three action buttons take the colour of the status they move seats INTO, so the
   button and the seats it is about to repaint agree. */
.btn-sell-active {
    background: var(--seat-status-sold);
}

.btn-return-active {
    background: var(--seat-status-available);
}

.btn-reserve-active {
    background: var(--seat-status-reserved);
}

/* An abonement reserves too, so it takes the reserved colour, darkened - the seats it
   is about to repaint go the same orange, but the two buttons stay distinguishable. */
.btn-abonement-active {
    background: #b9770e;
}

.btn-disabled {
    opacity: 0.6;
}

/* ===== USER INFO STYLES ===== */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

/* ===== LOGOUT BUTTON STYLES =====
   A tinted outline rather than the solid red it used to be: it now sits on the gradient
   header alongside every other page's, and solid red there reads as an error. */
.logout-btn {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ===== CHECKBOX STYLES ===== */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 1em;
    color: #2c3e50;
    font-weight: 500;
    margin: 0;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    min-width: 200px;
}

.checkbox-label:hover {
    background-color: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #28a745;
    border-color: #28a745;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: #007bff;
}

/* ===== ENVIRONMENT TOGGLE STYLES ===== */
.environment-toggle-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
}

.environment-toggle-group label {
    margin: 0;
    white-space: nowrap;
}

.tomsarkgh-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0px;
}

.tomsarkgh-group label {
    margin: 0;
    white-space: nowrap;
}

.tomsarkgh-group input {
    flex: 1;
    max-width: 115px;
}

/* Wide enough for FOUR characters, not two.
   The code is two Armenian letters, and ՈՒ and ԵՒ are one letter written with two
   characters each - so ՈՒԵՒ is an ordinary code. At the old 45px it was cut off mid
   letter, and an operator checking a code read a different one off the screen. */
.code-group {
    margin: 0;
    width: 68px;
}


.code-group input {
    width: 62px;
}


.environment-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.env-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-right: 1px solid #dee2e6;
    min-width: 60px;
}

.env-btn:last-child {
    border-right: none;
}

.env-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.env-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.env-btn.active:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.test-btn.active {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.test-btn.active:hover {
    background: linear-gradient(135deg, #e08e0b, #d35400);
}

/* Custom Tooltip Styles */
.custom-tooltip {
    /* Inherited rather than restated: the tooltip is body text like everything else,
       and a second copy of the stack is one more place to miss when it changes. */
    font-family: inherit;
    animation: fadeInTooltip 0.2s ease-out;
}

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

/* Hide clear button for date inputs */
input[type="date"]::-webkit-clear-button,
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

input[type="date"] {
    -webkit-appearance: none;
}

/* Firefox specific - hide clear button */
@-moz-document url-prefix() {
    input[type="date"]::-moz-clear-button {
        display: none;
    }
}

/* Alternative approach for Firefox */
input[type="date"]:focus::-moz-clear-button {
    display: none;
}

/* ===== STATS PAGE STYLES ===== */
.stats-container {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-placeholder {
    height: 300px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* ===== SALES TABLE STYLES ===== */
.sales-table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.sales-table-container h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.sales-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.sales-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #5a67d8;
    white-space: nowrap;
}

.sales-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.sales-table tr:nth-child(even) {
    background: #f8f9fa;
}

.sales-table tr:hover {
    background: #e3f2fd;
}

.sales-table .text-center {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Mobile responsive for sales table */
@media (max-width: 1024px) {
    .sales-table-container {
        padding: 15px;
        margin-top: 15px;
    }

    .sales-table {
        font-size: 0.8em;
    }

    .sales-table th,
    .sales-table td {
        padding: 8px 4px;
    }

    .sales-table th {
        font-size: 0.85em;
    }
}
