:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --dark-surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.event-info {
    font-size: 1.1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.event-info span {
    display: inline-block;
    margin: 0 1rem;
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--dark-surface);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.legend-seat {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-block;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

/* Theater */
.theater {
    background: var(--dark-surface);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.stage {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 1.5rem;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.stage::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
}

.seating-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.row-label {
    width: 60px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.seats {
    display: flex;
    gap: 0.5rem;
}

.seat {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--dark-surface-light), var(--dark-surface));
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.seat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.seat:hover::before {
    opacity: 1;
}

.seat.available:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--primary-light);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.seat.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-light);
    color: white;
    will-change: box-shadow;
    position: relative;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 5px 15px rgba(99, 102, 241, 0.5);
    }

    50% {
        box-shadow: 0 5px 25px rgba(99, 102, 241, 0.8);
    }
}

.seat.reserved {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    border-color: #94a3b8;
    color: #1e293b;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Selection Panel */
.selection-panel {
    background: var(--dark-surface);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    position: sticky;
    top: 2rem;
}

.selection-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.selected-seats-list {
    margin-bottom: 1.5rem;
    min-height: 100px;
}

.selected-seat-item {
    background: var(--dark-surface-light);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.remove-seat {
    background: var(--danger-color);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.remove-seat:hover {
    background: #dc2626;
    transform: rotate(90deg);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--dark-surface);
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--dark-surface-light);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: var(--dark-surface-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Admin Link */
.admin-link {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--secondary-color), #db2777);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
}

.admin-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(236, 72, 153, 0.4);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--dark-surface-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.success-message {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s;
}

.error-message {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .selection-panel {
        position: static;
        /*order: -1;*/
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .event-info {
        font-size: 0.9rem;
    }

    .event-info span {
        display: block;
        margin: 0.25rem 0;
    }

    .legend {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .theater {
        padding: 1.5rem;
    }

    .stage {
        padding: 1rem;
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .seat {
        width: 28px;
        height: 28px;
        font-size: 0.6rem;
        border-radius: 6px;
    }

    .row {
        gap: 0.3rem;
    }

    .seats {
        gap: 0.3rem;
    }

    .row-label {
        width: 35px;
        font-size: 0.75rem;
    }

    .selection-panel {
        padding: 1.5rem;
    }

    .selection-panel h2 {
        font-size: 1.25rem;
    }

    .admin-link {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}
