/* Стили для публичной части плагина Ticket System */



.ticket-event-page .entry-header {
    margin-bottom: 30px;
}

.ticket-event-page .event-date {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

.ticket-event-page .event-announcement {
    font-size: 16px;
    color: #333;
    margin: 15px 0;
    padding: 15px;
    background: #f0f0f1;
    border-radius: 4px;
}

.ticket-booking-section {
    margin-top: 40px;
}

.ticket-booking-section h2 {
    margin-bottom: 20px;
}

.hall-schema-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.hall-schema-wrapper {
    flex: 1;
    min-width: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
    max-height: 600px;
    height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* HTML контейнер для схемы (без Fabric.js) */
.hall-schema-html-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    overflow: visible;
    touch-action: pan-x pan-y;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
}

/* Контейнер canvas, который создает Fabric.js */
.canvas-container {
    max-width: 100% !important;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container canvas {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Кнопки зума */
.zoom-controls {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.zoom-btn:hover {
    background: #f0f0f1;
    border-color: #2271b1;
}

.zoom-btn:active {
    background: #e0e0e0;
    transform: scale(0.95);
}

.zoom-icon {
    line-height: 1;
}

.zoom-reset {
    display: none;
}

.selected-seats-panel {
    width: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.selected-seats-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

#selected-seats-list {
    margin-bottom: 15px;
}

#selected-seats-list .no-seats {
    color: #999;
    font-style: italic;
}

.selected-seat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.selected-seat-item:last-child {
    border-bottom: none;
}

.seat-info {
    font-size: 14px;
}

.seat-price {
    font-weight: bold;
    color: rgba(255, 85, 0, 1);
}

.total-price {
    padding-top: 15px;
    border-top: 2px solid #ddd;
    font-size: 18px;
    color: #333;
}

.total-price strong {
    display: block;
}

.total-price #total-price {
    color: #ff6214;
    font-size: 24px;
}

#buy-tickets-btn {
    display: none;
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#buy-tickets-btn.show,
#buy-tickets-btn[style*="display: block"] {
    display: block !important;
}

.btn-buy-tickets {
    background-color: #2271b1;
    color: #fff;
}

.btn-buy-tickets:hover {
    background-color: #135e96;
}

.booking-form-container {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.booking-form-container h3 {
    margin-top: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group .required {
    color: #d63638;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.button-primary {
    background: #2271b1;
    color: #fff;
}

.button-primary:hover {
    background: #135e96;
}

.button:not(.button-primary) {
    background: #f0f0f1;
    color: #333;
}

.button:not(.button-primary):hover {
    background: #dcdcde;
}

/* Стили для мест на схеме */
.seat-available {
    cursor: pointer;
}

.seat-selected {
    opacity: 0.7;
}

.seat-booked {
    opacity: 0.3;
    cursor: not-allowed;
}

.hall-seat.selected {
    box-shadow: 0 0 0 3px #f8b864;
}

/* Адаптивность для планшетов */
@media (max-width: 1200px) {
    .hall-schema-wrapper {
        height: 500px;
        max-height: 500px;
    }
}

@media (max-width: 992px) {
    .hall-schema-wrapper {
        height: 450px;
        max-height: 450px;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .ticket-booking-section {
        margin: 20px 0;
    }
    
    .hall-schema-container {
        margin: 20px 0;
        gap: 20px;
        flex-direction: column;
        min-height: 400px;
    }
    
    .selected-seats-panel {
        display: block;
        width: 100%;
        order: 2; /* Располагаем после канваса */
        max-height: none;
    }
    
    .hall-schema-wrapper {
        width: 100%;
        height: 400px;
        max-height: 400px;
        min-height: 400px;
        margin: 0;
        order: 1; /* Располагаем перед панелью выбранных мест */
    }
    
    .hall-schema-html-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .zoom-controls {
        right: 15px;
        padding: 8px 6px;
        gap: 12px;
    }
    
    .zoom-btn {
        width: 44px;
        height: 44px;
        font-size: 28px;
        border-radius: 50%;
    }
    
    .booking-form-container {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .zoom-controls {
        right: 10px;
        padding: 6px 4px;
        gap: 10px;
    }
    
    .zoom-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* Кастомное модальное окно */
.ticket-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ticket-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ticket-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ticket-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.ticket-modal-close:hover {
    color: #000;
}

.ticket-modal-body {
    padding: 12px 16px;
    flex: 1;
}

.ticket-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ticket-form-group {
    margin-bottom: 12px;
}

.ticket-form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.ticket-required {
    color: #d63638;
}

.ticket-form-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ticket-form-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Стили для методов оплаты */
.ticket-payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.ticket-payment-method-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 6px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 40px;
    text-align: center;
}

.ticket-payment-method-btn:hover {
    border-color: #2271b1;
    background: #f0f6fc;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.ticket-payment-method-btn.active {
    border-color: #2271b1;
    background: #e7f3ff;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.ticket-payment-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    color: #2271b1;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ticket-payment-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ticket-payment-method-btn.active .ticket-payment-icon {
    color: #2271b1;
}

.ticket-payment-label {
    font-size: 11px;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
}

/* Стили для чекбоксов согласия */
.ticket-checkbox-group {
    margin-bottom: 6px;
}

.ticket-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.ticket-checkbox-label input[type="checkbox"] {
    margin: 0 8px 0 0;
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.ticket-checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.ticket-checkbox-label span {
    flex: 1;
}

.ticket-checkbox-label a {
    color: #2271b1;
    text-decoration: underline;
}

.ticket-checkbox-label a:hover {
    color: #135e96;
}

.ticket-payment-method-btn.active .ticket-payment-label {
    color: #2271b1;
    font-weight: 600;
}

@media (max-width: 480px) {
    .ticket-payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }

    .ticket-payment-method-btn {
        min-height: 40px;
        padding: 8px 6px;
    }

    .ticket-payment-label {
        font-size: 11px;
    }
}

.ticket-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    text-decoration: none;
    display: inline-block;
}

.ticket-btn-primary {
    background-color: #2271b1;
    color: #fff;
}

.ticket-btn-primary:hover {
    background-color: #135e96;
}

.ticket-btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.ticket-btn-secondary {
    background-color: #f0f0f1;
    color: #333;
}

.ticket-btn-secondary:hover {
    background-color: #dcdcde;
}

/* Кнопка бронирования админом */
.btn-admin-book {
    background-color: #ff9800;
    color: #fff;
    border: 2px solid #e68a00;
}

.btn-admin-book:hover {
    background-color: #e68a00;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .ticket-modal {
        max-width: 100%;
        margin: 10px;
    }
    
    .ticket-modal-header,
    .ticket-modal-body,
    .ticket-modal-footer {
        padding: 15px;
    }
    
    .ticket-modal-footer {
        /* column-reverse: кнопка «Оплатить» (последняя в разметке) оказывается
           выше кнопки «Отмена» на мобильных устройствах */
        flex-direction: column-reverse;
    }
    
    .ticket-btn {
        width: 100%;
    }
}
