/**
 * WWC Ticketing - WordPress Plugin Styles
 */

/* Variables */
:root {
    --wwc-primary: #2563eb;
    --wwc-primary-dark: #1d4ed8;
    --wwc-success: #10b981;
    --wwc-danger: #ef4444;
    --wwc-warning: #f59e0b;
    --wwc-gray-50: #f9fafb;
    --wwc-gray-100: #f3f4f6;
    --wwc-gray-200: #e5e7eb;
    --wwc-gray-300: #d1d5db;
    --wwc-gray-400: #9ca3af;
    --wwc-gray-500: #6b7280;
    --wwc-gray-600: #4b5563;
    --wwc-gray-700: #374151;
    --wwc-gray-800: #1f2937;
    --wwc-gray-900: #111827;
    --wwc-radius: 8px;
    --wwc-radius-lg: 12px;
    --wwc-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --wwc-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* Reset for plugin elements */
.wwc-ticketing-shows *,
.wwc-ticketing-single * {
    box-sizing: border-box;
}

/* =====================
   Show List Grid
   ===================== */
.wwc-ticketing-shows {
    display: grid;
    gap: 24px;
}

.wwc-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.wwc-layout-list .wwc-show-card {
    display: flex;
    flex-direction: row;
}

.wwc-ticketing-no-shows {
    padding: 40px;
    text-align: center;
    background: var(--wwc-gray-50);
    border-radius: var(--wwc-radius-lg);
    color: var(--wwc-gray-600);
}

/* Show Card */
.wwc-show-card {
    background: white;
    border-radius: var(--wwc-radius-lg);
    box-shadow: var(--wwc-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.wwc-show-card:hover {
    box-shadow: var(--wwc-shadow-lg);
    transform: translateY(-2px);
}

.wwc-show-card.sold-out {
    opacity: 0.8;
}

.wwc-show-card .show-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.wwc-show-card .show-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wwc-show-card .sold-out-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--wwc-danger);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wwc-show-card .show-content {
    padding: 20px;
    display: flex;
    gap: 16px;
}

.wwc-show-card .show-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 8px;
    background: var(--wwc-primary);
    color: white;
    border-radius: var(--wwc-radius);
    text-align: center;
}

.wwc-show-card .show-date .month {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wwc-show-card .show-date .day {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.wwc-show-card .show-details {
    flex: 1;
}

.wwc-show-card .show-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.3;
}

.wwc-show-card .show-title a {
    color: var(--wwc-gray-900);
    text-decoration: none;
}

.wwc-show-card .show-title a:hover {
    color: var(--wwc-primary);
}

.wwc-show-card .show-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--wwc-gray-500);
    margin-bottom: 8px;
}

.wwc-show-card .show-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wwc-show-card .show-meta svg {
    color: var(--wwc-gray-400);
}

.wwc-show-card .show-description {
    font-size: 14px;
    color: var(--wwc-gray-600);
    margin: 8px 0;
    line-height: 1.5;
}

.wwc-show-card .show-pricing {
    margin-top: 12px;
}

.wwc-show-card .price-from {
    font-size: 16px;
    font-weight: 600;
    color: var(--wwc-primary);
}

.wwc-show-card .show-action {
    display: flex;
    align-items: flex-end;
}

.wwc-show-card .btn-buy-tickets {
    display: inline-block;
    padding: 10px 20px;
    background: var(--wwc-primary);
    color: white;
    border-radius: var(--wwc-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.wwc-show-card .btn-buy-tickets:hover {
    background: var(--wwc-primary-dark);
}

.wwc-show-card .btn-sold-out {
    display: inline-block;
    padding: 10px 20px;
    background: var(--wwc-gray-300);
    color: var(--wwc-gray-600);
    border-radius: var(--wwc-radius);
    font-weight: 600;
    font-size: 14px;
    cursor: not-allowed;
}

/* =====================
   Single Show Page
   ===================== */
.wwc-ticketing-single {
    max-width: 900px;
    margin: 0 auto;
}

.wwc-show-header {
    margin-bottom: 32px;
}

.wwc-show-header .show-hero-image {
    border-radius: var(--wwc-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.wwc-show-header .show-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.wwc-show-header .show-title {
    font-size: 32px;
    margin: 0 0 20px;
    color: var(--wwc-gray-900);
}

.wwc-show-header .show-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.wwc-show-header .meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--wwc-gray-50);
    border-radius: var(--wwc-radius);
}

.wwc-show-header .meta-item svg {
    color: var(--wwc-primary);
    flex-shrink: 0;
}

.wwc-show-header .meta-label {
    display: block;
    font-size: 12px;
    color: var(--wwc-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.wwc-show-header .meta-value {
    display: block;
    font-size: 15px;
    color: var(--wwc-gray-800);
    font-weight: 500;
}

.wwc-show-header .meta-value small {
    font-size: 13px;
    color: var(--wwc-gray-500);
    font-weight: normal;
}

.wwc-show-header .show-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--wwc-gray-700);
}

/* Notices */
.wwc-notice {
    padding: 32px;
    text-align: center;
    border-radius: var(--wwc-radius-lg);
    margin-bottom: 24px;
}

.wwc-notice h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.wwc-notice p {
    margin: 0;
    color: var(--wwc-gray-600);
}

.wwc-notice.sold-out {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.wwc-notice.sold-out h3 {
    color: var(--wwc-danger);
}

.wwc-notice.not-open,
.wwc-notice.closed {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.wwc-notice.not-open h3,
.wwc-notice.closed h3 {
    color: var(--wwc-warning);
}

/* =====================
   Ticket Selection
   ===================== */
.wwc-ticket-section h2 {
    font-size: 24px;
    margin: 0 0 24px;
    color: var(--wwc-gray-900);
}

.wwc-ticket-section h3 {
    font-size: 16px;
    margin: 0 0 16px;
    color: var(--wwc-gray-800);
}

.wwc-ticket-types {
    margin-bottom: 24px;
}

.wwc-ticket-type {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid var(--wwc-gray-200);
    border-radius: var(--wwc-radius);
    margin-bottom: 12px;
}

.wwc-ticket-type.unavailable {
    opacity: 0.6;
}

.wwc-ticket-type .ticket-info {
    flex: 1;
}

.wwc-ticket-type .ticket-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--wwc-gray-800);
}

.wwc-ticket-type .ticket-description {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--wwc-gray-500);
}

.wwc-ticket-type .ticket-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.wwc-ticket-type .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--wwc-gray-900);
}

.wwc-ticket-type .price.member {
    color: var(--wwc-success);
}

.wwc-ticket-type .price.strikethrough {
    font-size: 14px;
    color: var(--wwc-gray-400);
    text-decoration: line-through;
    font-weight: normal;
}

.wwc-ticket-type .price-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--wwc-success);
    color: white;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.wwc-ticket-type .ticket-quantity {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wwc-ticket-type .qty-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #d1d5db !important;
    background-color: #ffffff !important;
    border-radius: 8px;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.wwc-ticket-type .qty-btn:hover:not(:disabled) {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

.wwc-ticket-type .qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
}

.wwc-ticket-type .qty-input {
    width: 60px;
    height: 44px;
    text-align: center;
    border: 2px solid #d1d5db !important;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #111827 !important;
    background-color: #ffffff !important;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
    margin: 0 4px;
}

.wwc-ticket-type .qty-input::-webkit-outer-spin-button,
.wwc-ticket-type .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wwc-ticket-type .qty-input:focus {
    outline: none;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wwc-ticket-type .unavailable-text {
    color: var(--wwc-danger);
    font-weight: 600;
    font-size: 14px;
}

/* =====================
   Seating Chart
   ===================== */
.wwc-seating-section {
    margin-bottom: 24px;
}

.wwc-seating-chart-wrapper {
    background: var(--wwc-gray-100);
    border-radius: var(--wwc-radius-lg);
    padding: 20px;
    overflow-x: auto;
}

.wwc-seating-chart {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wwc-seating-chart .loading {
    color: var(--wwc-gray-500);
}

.wwc-seating-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--wwc-gray-600);
}

.wwc-seating-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wwc-seating-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.wwc-seating-legend .dot.available {
    background: var(--wwc-success);
}

.wwc-seating-legend .dot.selected {
    background: var(--wwc-primary);
}

.wwc-seating-legend .dot.sold {
    background: var(--wwc-danger);
}

.wwc-selected-seats {
    margin-top: 16px;
    padding: 16px;
    background: white;
    border: 1px solid var(--wwc-gray-200);
    border-radius: var(--wwc-radius);
}

.wwc-selected-seats .no-selection {
    color: var(--wwc-gray-500);
    text-align: center;
    margin: 0;
}

/* =====================
   Order Summary
   ===================== */
.wwc-order-summary {
    background: var(--wwc-gray-50);
    border-radius: var(--wwc-radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.wwc-order-summary h3 {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wwc-gray-200);
}

.wwc-order-summary .summary-items {
    min-height: 40px;
}

.wwc-order-summary .empty-summary {
    color: var(--wwc-gray-500);
    text-align: center;
    margin: 0;
}

.wwc-order-summary .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--wwc-gray-200);
}

.wwc-order-summary .summary-item:last-child {
    border-bottom: none;
}

.wwc-order-summary .summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 2px solid var(--wwc-gray-300);
    font-size: 18px;
    font-weight: 700;
}

.wwc-order-summary .total-amount {
    color: var(--wwc-primary);
}

/* =====================
   Customer Form
   ===================== */
.wwc-customer-form {
    background: white;
    border: 1px solid var(--wwc-gray-200);
    border-radius: var(--wwc-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.wwc-customer-form h3 {
    margin-bottom: 16px;
}

.wwc-customer-form .member-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: var(--wwc-radius);
    margin-bottom: 20px;
    font-size: 14px;
    color: #065f46;
}

.wwc-customer-form .member-badge {
    padding: 4px 10px;
    background: var(--wwc-success);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.wwc-customer-form .member-prompt {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: var(--wwc-gray-50);
    border-radius: var(--wwc-radius);
    font-size: 14px;
    color: var(--wwc-gray-600);
}

.wwc-customer-form .member-prompt a {
    color: var(--wwc-primary);
    font-weight: 600;
}

.wwc-customer-form .form-row {
    margin-bottom: 16px;
}

.wwc-customer-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--wwc-gray-700);
    margin-bottom: 6px;
}

.wwc-customer-form .required {
    color: var(--wwc-danger);
}

.wwc-customer-form input[type="text"],
.wwc-customer-form input[type="email"],
.wwc-customer-form input[type="tel"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--wwc-gray-300);
    border-radius: var(--wwc-radius);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wwc-customer-form input:focus {
    outline: none;
    border-color: var(--wwc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wwc-customer-form small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--wwc-gray-500);
}

/* =====================
   Checkout Action
   ===================== */
.wwc-checkout-action {
    text-align: center;
}

.wwc-checkout-btn {
    width: 100%;
    max-width: 400px;
    padding: 16px 32px;
    background: var(--wwc-primary);
    color: white;
    border: none;
    border-radius: var(--wwc-radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wwc-checkout-btn:hover:not(:disabled) {
    background: var(--wwc-primary-dark);
}

.wwc-checkout-btn:disabled {
    background: var(--wwc-gray-300);
    cursor: not-allowed;
}

.wwc-checkout-action .secure-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--wwc-gray-500);
}

.wwc-checkout-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--wwc-radius);
    font-size: 14px;
    text-align: center;
}

/* =====================
   Comp Code Field
   ===================== */
.wwc-comp-code-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--wwc-gray-300);
}

.comp-code-input-wrapper {
    display: flex;
    gap: 8px;
}

.comp-code-input-wrapper input.wwc-comp-code {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--wwc-gray-300);
    border-radius: var(--wwc-radius);
    font-size: 15px;
    font-family: monospace;
    letter-spacing: 1px;
}

.comp-code-input-wrapper input.wwc-comp-code:focus {
    outline: none;
    border-color: var(--wwc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comp-code-input-wrapper input.wwc-comp-code:disabled {
    background: var(--wwc-gray-100);
    color: var(--wwc-gray-600);
}

.wwc-apply-comp-btn {
    padding: 10px 20px;
    background: var(--wwc-gray-700);
    color: white;
    border: none;
    border-radius: var(--wwc-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.wwc-apply-comp-btn:hover:not(:disabled) {
    background: var(--wwc-gray-800);
}

.wwc-apply-comp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wwc-comp-code-status {
    margin-top: 8px;
    font-size: 14px;
}

.wwc-comp-code-status .comp-success {
    color: var(--wwc-success);
    font-weight: 500;
}

.wwc-comp-code-status .comp-error {
    color: var(--wwc-danger);
}

.wwc-order-summary .summary-item.comp-discount {
    color: var(--wwc-success);
    font-weight: 500;
}

.wwc-order-summary .summary-item.comp-tickets {
    color: var(--wwc-success);
    font-weight: 600;
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 768px) {
    .wwc-show-header .show-title {
        font-size: 24px;
    }

    .wwc-show-header .show-meta-grid {
        grid-template-columns: 1fr;
    }

    .wwc-ticket-type {
        flex-wrap: wrap;
    }

    .wwc-ticket-type .ticket-pricing {
        min-width: auto;
    }

    .wwc-ticket-type .ticket-quantity {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }

    .wwc-show-card .show-content {
        flex-direction: column;
    }

    .wwc-show-card .show-date {
        flex-direction: row;
        gap: 8px;
    }
}
