/**
 * Public CSS for Tav Event Ticketing Plugin
 */

/* General Styles */
.tav-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.tav-loading {
    text-align: center;
    padding: 20px;
}

.tav-error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 5px;
    margin-bottom: 20px;
}

.tav-notice {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    border-radius: 5px;
    margin-bottom: 20px;
}

.tav-success-message {
    padding: 15px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 5px;
    margin: 15px 0;
}

/* Event Info */
.tav-event-info {
    margin-bottom: 30px;
}

.tav-event-image {
    margin-bottom: 20px;
}

.tav-event-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.tav-event-meta {
    margin-bottom: 20px;
}

.tav-event-meta-item {
    margin-bottom: 10px;
}

.tav-event-meta-label {
    font-weight: bold;
    margin-right: 5px;
}

.tav-event-description {
    margin-bottom: 20px;
}

/* Seat Map */
.tav-seat-map {
    margin-bottom: 30px;
}

/* Seat Map Frontend */
.tav-seat-map-frontend-container {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

@media (min-width: 992px) {
    .tav-seat-map-frontend-container {
        flex-wrap: nowrap;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .tav-seat-map-wrapper {
        flex: 0 0 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .tav-seat-selection-summary {
        flex: 0 0 22%;
        position: sticky;
        top: 30px;
        font-size: 0.9em;
        padding: 15px;
        border-left: 1px solid #eee;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
}

/* Mobile layout - stacked with sidebar below */
@media (max-width: 991px) {
    .tav-seat-map-frontend-container {
        flex-direction: column;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .tav-seat-map-wrapper {
        width: 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .tav-seat-selection-summary {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        border-top: 1px solid #eee;
    }
}

.tav-hotspot-map-container {
    width: 100%;
    height: 600px;
    overflow: hidden;
    position: relative;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

@media (max-width: 767px) {
    .tav-hotspot-map-container {
        height: 450px;
    }
}

.tav-venue-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.tav-venue-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.tav-seat-map-controls {
    margin-bottom: 8px;
}

.tav-zoom-button {
    padding: 5px 10px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.tav-zoom-button:hover {
    background: #e9e9e9;
}

.tav-seat-hotspots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tav-seat-hotspots .hotspot {
    position: absolute;
    width: 25px;
    height: 25px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tav-map-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tav-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    animation: tav-spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

#tav-seat-map-container {
    position: relative;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    background: #f9f9f9;
}

#tav-seat-map-canvas {
    display: block;
    background: #fff;
}

.tav-seat-map-legend {
    margin-top: 10px;
    padding: 8px;
}

.tav-legend-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tav-legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85em;
    margin-bottom: 2px;
}

.tav-legend-color {
    width: 12px;
    height: 12px;
    margin-right: 5px;
}

.tav-legend-available .tav-legend-color {
    background: #3498db;
}

.tav-legend-selected .tav-legend-color {
    background: #27ae60;
}

.tav-legend-sold .tav-legend-color {
    background: #95a5a6;
    opacity: 0.5;
}

.tav-legend-reserved .tav-legend-color {
    background: #e74c3c;
    opacity: 0.5;
}

/* Booking Form */
.tav-booking-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 5px;
}

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

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

.tav-form-group select {
    width: 100%;
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.tav-selected-seats-container {
    margin-top: 15px;
}

.tav-selected-seats-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.tav-selected-seats {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.tav-selected-seats li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tav-selected-seats li:last-child {
    border-bottom: none;
}

.tav-no-seats {
    color: #666;
    font-style: italic;
}

.tav-seat-price {
    font-weight: bold;
}

.tav-remove-seat {
    color: #e74c3c;
    text-decoration: none;
}

.tav-remove-seat:hover {
    color: #c0392b;
}

.tav-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    padding: 10px 0;
    margin: 15px 0;
    border-top: 1px solid #ddd;
}

.tav-add-to-cart {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
}

.tav-add-to-cart:hover {
    background: #27ae60;
}

.tav-add-to-cart:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

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

/* Responsive Adjustments */
@media (min-width: 768px) {
    .tav-event-layout {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 30px;
    }
    
    .tav-seat-map {
        grid-column: 1;
    }
    
    .tav-booking-sidebar {
        grid-column: 2;
    }
}

@media (max-width: 767px) {
    .tav-add-to-cart {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .tav-map-legend {
        flex-direction: column;
        gap: 8px;
    }
}



/* Selected seats list */
.tav-selected-seats-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tav-selected-seats-list li {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tav-selected-seats-list li:last-child {
    border-bottom: none;
}

.tav-no-seats-selected {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.tav-category-header {
    background-color: #f9f9f9;
    padding: 5px 10px;
    font-weight: bold;
}

.tav-selected-seat-item .tav-remove-seat {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 16px;
    cursor: pointer;
    padding: 0 5px;
    margin-left: auto;
}

.tav-selected-seat-item .tav-remove-seat:hover {
    color: #c0392b;
}

.tav-seat-cat-price {
    margin-left: 10px;
    color: #777;
}

/* کاهش فاصله‌ها در سایدبار */
.tav-seat-selection-summary h3,
.tav-seat-selection-summary h4 {
    margin-top: 10px;
    margin-bottom: 8px;
    font-size: 1em;
}

.tav-add-to-cart-btn {
    padding: 8px 12px;
    font-size: 0.9em;
}

.tav-legend-categories,
.tav-legend-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tav-legend-categories .tav-legend-item {
    flex: 0 0 48%;
    margin-bottom: 3px;
}

.tav-legend-statuses .tav-legend-item {
    flex: 0 0 48%;
    margin-bottom: 3px;
}

.tav-legend-label {
    max-width: calc(100% - 18px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 767px) {
    .tav-legend-categories .tav-legend-item,
    .tav-legend-statuses .tav-legend-item {
        flex: 0 0 47%;
    }
    
    .tav-legend-categories,
    .tav-legend-statuses {
        border-top: 1px solid #ddd;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .tav-seat-map-legend h4 {
        margin-top: 15px;
    }
}

/* تنظیمات بهتر برای صفحه نمایش‌های کوچک */
@media (max-width: 550px) {
    .tav-legend-categories,
    .tav-legend-statuses {
        flex-direction: column;
    }
}

/* تنظیمات کلی برای نمای فشرده */
.tav-seat-map-wrapper {
    margin-bottom: 15px;
}

.tav-add-to-cart-container {
    margin: 8px 0 12px;
}

/* افزایش ارتفاع بخش نمایش صندلی‌های انتخاب شده */
@media (min-width: 992px) {
    .tav-selected-seats-list {
        max-height: 150px;
    }
}

/* Cart quantity controls for event tickets */
.woocommerce-cart-form__cart-item:has([data-ticket="true"]) .quantity .qty {
    pointer-events: none;
    background-color: #f9f9f9;
    border-color: #ddd;
    opacity: 0.7;
}

.woocommerce-cart-form__cart-item:has([data-ticket="true"]) .quantity .minus,
.woocommerce-cart-form__cart-item:has([data-ticket="true"]) .quantity .plus {
    display: none !important;
} 