/* Import Kanit font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: #1d1d1d;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Banner */

.navigation {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    position: absolute;
    top: 0;
    right: 0;

    gap: 10px;

    margin: 10px;

    z-index: 1000;
}

.navigation-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    background-color: #1d1d1d;
    padding: 10px;
    border-radius: 10px;
    gap: 10px;

    color: #eeeeee;

    cursor: pointer;
    transition: all 0.3s ease;
}

.navigation-item:hover {
    background-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.container-banner {
    width: 100%;
    height: 100%;

    position: relative;

    color: #eeeeee;
}

.container-banner img {
    width: auto;
    height: fit-content;
    max-height: 900px;
    object-fit: cover;

    margin: 0 auto;
    width: 100%;
    height: auto;
}

.container-detail {

    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0px;

    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 20px;
    width: fit-content;

    background-color: #1d1d1d;
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;


}

.container-detail .calendar {
    display: flex;
    flex-direction: column;
    align-items: start;
    width: 200px;
    justify-content: start;
    gap: 10px;
    
    padding: 10px;
    border-left: 1px solid #eeeeee;

    .calendar-icon {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: start;
        gap: 10px;
    }
}



.container-detail .time {
    display: flex;
    flex-direction: column;
    width: 200px;
    align-items: start;
    justify-content: start;
    gap: 10px;

    padding: 10px;
    border-left: 1px solid #ccc;

    .time-icon {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: start;
        gap: 10px;
    }
}

.container-detail .location {
    display: flex;
    flex-direction: column;
    width: 200px;
    align-items: start;
    justify-content: start;
    gap: 10px;

    padding: 10px;
    border-left: 1px solid #ccc;

    .location-icon {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: start;
        gap: 10px;
    }
}

.container-detail .calendar i,
.container-detail .time i,
.container-detail .location i {
    font-size: 20px;
}

.container-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;

    padding: 10px;
}

.container-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 10px;
    border-radius: 10px;
    background-color: #2b2b2b;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    margin-bottom: 30px;
}

.container-header h1 {
    text-align: center;
    color: #ececec;
    font-weight: 600;
    font-size: 24px;
}

.container-title {
    padding: 15px;
    border-radius: 10px;
    background-color: #2b2b2b;
    width: 100%;
    max-width: 700px;

    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    gap: 10px;

    margin-bottom: 30px;
}

.container-title h2 {
    text-align: center;
    color: #ececec;
    font-weight: 600;
    font-size: 24px;
}

.container-title p {
    text-align: center;
    color: #ececec;
    font-weight: 400;
    font-size: 16px;
}

.map-link {
    margin: 5px 0;
}

.map-link a {
    color: #59a2f5;
    text-decoration: none;
    display: inline-block;
    padding: 5px 15px;
    background-color: rgba(89, 162, 245, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.map-link a:hover {
    background-color: rgba(89, 162, 245, 0.2);
    transform: translateY(-2px);
}

.line {
    width: 100%;        /* ความกว้างเต็ม container */
    height: 1px;        /* ความหนาของเส้น */
    background-color: #ccc;  /* สีของเส้น */
    margin: 20px 0;     /* เว้นระยะบนและล่าง */
}

.container-table {
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);

    margin-bottom: 30px;
}

.seating-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 40px 20px;
}

.seat {
    width: 45px;
    height: 45px;
    background-color: #e0e0e0;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.empty-seat {
    width: 45px;
    height: 45px;
    visibility: hidden;
}

.seat:hover {
    background-color: #d0d0d0;
    transform: scale(1.1);
    z-index: 2;
}

.seat.available {
    background-color: #4CAF50;
    border-color: #45a049;
    color: white;
}

.seat.occupied {
    background-color: #f44336;
    border-color: #da190b;
    color: white;
    cursor: pointer;
}

.seat.selected {
    background-color: #2196F3;
    border-color: #1976D2;
    color: white;
    transform: scale(1.1);
}

/* Row layout styling */
.row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 45px;
}

/* Stage styling */
.stage {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
    color: white;
    font-weight: 600;
    font-size: 16px;
    border-radius: 10px;
    width: 100px;
    height: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin: 0 10px;
    visibility: hidden; /* ซ่อนเวทีแต่ยังคงพื้นที่ไว้ */
}

/* Bottom row styling */
.bottom-row {
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

/* Remove old stage indicator since we have a proper stage element */

/* Responsive design */
@media (max-width: 1024px) {
    .container-table {
        padding: 25px;
        margin: 0 20px;
    }
    
    .container-detail {
        gap: 15px;
        padding: 8px 15px;
    }
    
    .container-detail .calendar,
    .container-detail .time,
    .container-detail .location {
        width: 200px;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .navigation {
        gap: 5px;
        margin: 5px;
    }

    .navigation-item {
        font-size: 12px;
        padding: 5px;
        gap: 5px;
    }

    .container-table {
        padding: 20px;
        margin: 0 15px;
    }
    
    .container-detail {
        position: static;
        transform: none;
        left: auto;
        bottom: auto;
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 6px 10px;
        width: 95%;
        margin: 10px auto 0;

        border-radius: 10px;

        background-color: #313131;
    }
    
    .container-detail .calendar,
    .container-detail .time,
    .container-detail .location {
        width: 100%;
        padding: 6px;
        border-left: none;
        border-bottom: 1px solid #ccc;
    }
    
    .container-detail .location {
        border-bottom: none;
    }
    
    .seating-layout {
        gap: 10px;
        max-width: 500px;
    }
    
    .row {
        gap: 10px;
    }
    
    .seat {
        width: 35px;
        height: 35px;
        font-size: 11px;
    }
    
    .stage {
        width: 80px;
        height: 35px;
        font-size: 12px;
        margin: 0 5px;
    }
    
    .bottom-row {
        gap: 15px;
    }
    
    .seat-legend {
        gap: 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .navigation {
        gap: 2px;
        margin: 2px;
    }

    .navigation-item {
        font-size: 10px;
    }

    .container-table {
        padding: 15px;
        margin: 0 10px;
    }
    
    .container-detail {
        position: static;
        transform: none;
        left: auto;
        bottom: auto;
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 6px 10px;
        width: 95%;
        margin: 10px auto 0;

        background-color: #313131;
    }
    
    .container-detail .calendar,
    .container-detail .time,
    .container-detail .location {
        width: 100%;
        padding: 6px;
        border-left: none;
        border-bottom: 1px solid #ccc;
    }
    
    .container-detail .location {
        border-bottom: none;
    }
    
    .container-detail .calendar i,
    .container-detail .time i,
    .container-detail .location i {
        font-size: 14px;
    }
    
    .seating-layout {
        gap: 8px;
        max-width: 100%;
    }
    
    .row {
        gap: 8px;
    }
    
    .seat {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
    
    .stage {
        width: 70px;
        height: 30px;
        font-size: 10px;
        margin: 0 3px;
    }
    
    .bottom-row {
        gap: 10px;
    }
    
    .seat-legend {
        flex-direction: row;
        gap: 8px;
        margin-top: 20px;
        font-size: 12px;
    }
    
    .legend-color {
        width: 18px;
        height: 18px;
    }
}

/* Extra small screens - below 370px */
@media (max-width: 370px) {

    .container-table {
        padding: 12px;
        margin: 5px;
        border-radius: 8px;
    }
    
    .container-detail {
        position: static;
        transform: none;
        left: auto;
        bottom: auto;
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 6px 10px;
        width: 95%;
        margin: 10px auto 0;

        background-color: #313131;
    }
    
    .container-detail .calendar,
    .container-detail .time,
    .container-detail .location {
        width: 100%;
        padding: 6px;
        border-left: none;
        border-bottom: 1px solid #ccc;
        font-size: 12px;
    }
    
    .container-detail .location {
        border-bottom: none;
    }
    
    .container-detail .calendar i,
    .container-detail .time i,
    .container-detail .location i {
        font-size: 14px;
    }
    
    .seating-layout {
        gap: 6px;
        max-width: 100%;
    }
    
    .row {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .seat {
        width: 25px;
        height: 25px;
        font-size: 9px;
    }
    
    .stage {
        width: 50px;
        height: 25px;
        font-size: 9px;
        margin: 0 2px;
    }
    
    .bottom-row {
        gap: 6px;
    }
    
    .seat-legend {
        flex-direction: row;
        gap: 6px;
        margin-top: 15px;
        font-size: 11px;
    }
    
    .legend-item {
        font-size: 11px;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
}


/* Legend */
.seat-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
}

.legend-available { background-color: #4CAF50; }
.legend-occupied { background-color: #f44336; }
.legend-selected { background-color: #2196F3; }

/* Booking popup styles */
.booking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.booking-popup {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.popup-header h3 {
    margin: 0;
    color: #333;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.popup-content {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-family: 'Kanit', sans-serif;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Kanit', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cancel-btn, .confirm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background-color: #f44336;
    color: white;
}

.cancel-btn:hover {
    background-color: #da190b;
    transform: translateY(-2px);
}

.confirm-btn {
    background-color: #4CAF50;
    color: white;
}

.confirm-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.confirm-cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f44336;
    color: white;
}

.confirm-cancel-btn:hover {
    background-color: #da190b;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Success popup styles */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.success-popup {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.success-icon {
    font-size: 80px;
    margin: 20px 0 10px 0;
    animation: bounce 0.6s ease;
}

.success-content {
    padding: 20px 30px;
}

.success-content h2 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Kanit', sans-serif;
}

.success-content p {
    margin: 10px 0;
    font-size: 16px;
    line-height: 1.5;
    font-family: 'Kanit', sans-serif;
}

.booking-details {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.booking-details p {
    margin: 8px 0;
    font-size: 14px;
}

.success-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    border-radius: 25px;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin: 20px 0 30px 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.success-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Error popup styles */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

.error-popup {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.error-icon {
    font-size: 80px;
    margin: 20px 0 10px 0;
    animation: shake 0.6s ease;
}

.error-content {
    padding: 20px 30px;
}

.error-content h2 {
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.error-content p {
    font-size: 16px;
    margin: 10px 0;
    line-height: 1.5;
}

.error-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    border-radius: 25px;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin: 20px 0 30px 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.error-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Loading message styles */
.loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #eeeeee;
    font-size: 16px;
}

.loading-message i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #59a2f5;
}

.loading-message p {
    margin: 0;
    font-family: 'Kanit', sans-serif;
}