/* TicketMax Frontend Styles - EXACTAMENTE IGUAL AL EDITOR */

/* Seat Selection Button - Ultra-modern style */
.ticketmax-seat-selection-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
}

#ticketmax-select-seats {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    background: rgba(26, 26, 26, 0.9);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    letter-spacing: 0.01em;
    box-shadow: 0 8px 32px rgba(26, 26, 26, 0.1);
}

#ticketmax-select-seats:hover {
    background: rgba(26, 26, 26, 1);
    transform: translateY(-1px);
    box-shadow: 0 12px 40px rgba(26, 26, 26, 0.15);
}

/* Modal Styles - EXACTAMENTE IGUAL AL EDITOR */
.ticketmax-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.ticketmax-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 16px 64px rgba(0,0,0,0.08);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ticketmax-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
}

.ticketmax-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: white;
    letter-spacing: -0.01em;
}

.ticketmax-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ticketmax-close:hover {
    color: rgba(255, 255, 255, 0.7);
}

.ticketmax-modal-body {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.ticketmax-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(248, 249, 250, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(26, 26, 26, 0.06);
    border-radius: 0 0 24px 24px;
}

.selected-seats-info {
    font-size: 14px;
    font-weight: 500;
    color: rgba(26, 26, 26, 0.8);
    letter-spacing: 0.01em;
}

#add-selected-seats {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#add-selected-seats:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#add-selected-seats:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Seating Chart Container */
#ticketmax-seat-chart-container {
    width: 100%;
    height: 500px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.seating-chart-canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Seat Legend */
.seat-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #333;
}

.legend-available { background: #4CAF50; }
.legend-selected { background: #2196F3; }
.legend-reserved { background: #FF9800; }
.legend-sold { background: #F44336; }

/* Loading State */
.loading-seats {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ticketmax-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .ticketmax-modal-header {
        padding: 15px 20px;
    }
    
    .ticketmax-modal-header h3 {
        font-size: 20px;
    }
    
    .ticketmax-modal-body {
        padding: 20px;
    }
    
    #ticketmax-seat-chart-container {
        height: 300px;
    }
    
    .ticketmax-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .seat-legend {
        gap: 10px;
    }
    
    .legend-item {
        font-size: 12px;
    }
}

/* Seat Styles within Canvas */
.seat {
    cursor: pointer;
    transition: all 0.2s ease;
}

.seat:hover {
    stroke-width: 2;
}

.seat-available {
    fill: #4CAF50;
    stroke: #2E7D32;
}

.seat-selected {
    fill: #2196F3;
    stroke: #1565C0;
}

.seat-reserved {
    fill: #FF9800;
    stroke: #E65100;
}

.seat-sold {
    fill: #F44336;
    stroke: #C62828;
    cursor: not-allowed;
}

/* Seat Labels */
.seat-label {
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: bold;
    fill: white;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.chart-control-btn {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-control-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.chart-control-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Error Messages */
.ticketmax-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #f44336;
}

/* Success Messages */
.ticketmax-success {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}

/* Stage/Screen indicator */
.stage-indicator {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zoom-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* Canvas overlay for pan mode */
.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: grab;
}

.canvas-overlay.panning {
    cursor: grabbing;
}