/**
 * EventHex Checkout - Complete CSS
 * Matching Next.js Tailwind implementation
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Primary Colors (6 shades) */
    --eh-primary: #007bff;
    --eh-primary-darker: #0056b3;
    --eh-primary-dark: #004085;
    --eh-primary-light: #66b0ff;
    --eh-primary-lighter: #b3d9ff;
    --eh-primary-lightest: #e6f2ff;

    /* Theme Colors */
    --eh-theme: #022753;
    --eh-secondary: #6c757d;
    --eh-theme-text: #ffffff;

    /* Neutral Colors */
    --eh-gray-50: #f9fafb;
    --eh-gray-100: #f3f4f6;
    --eh-gray-200: #e5e7eb;
    --eh-gray-300: #d1d5db;
    --eh-gray-400: #9ca3af;
    --eh-gray-500: #6b7280;
    --eh-gray-600: #4b5563;
    --eh-gray-700: #374151;
    --eh-gray-800: #1f2937;
    --eh-gray-900: #111827;

    /* Semantic Colors */
    --eh-success: #10b981;
    --eh-error: #ef4444;
    --eh-warning: #f59e0b;
    --eh-info: #3b82f6;

    /* Spacing */
    --eh-spacing-xs: 0.25rem;
    --eh-spacing-sm: 0.5rem;
    --eh-spacing-md: 1rem;
    --eh-spacing-lg: 1.5rem;
    --eh-spacing-xl: 2rem;
    --eh-spacing-2xl: 3rem;

    /* Border Radius */
    --eh-radius-sm: 0.25rem;
    --eh-radius-md: 0.375rem;
    --eh-radius-lg: 0.5rem;
    --eh-radius-xl: 0.75rem;

    /* Shadows */
    --eh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --eh-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --eh-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --eh-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Typography */
    --eh-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --eh-font-size-xs: 0.75rem;
    --eh-font-size-sm: 0.875rem;
    --eh-font-size-base: 1rem;
    --eh-font-size-lg: 1.125rem;
    --eh-font-size-xl: 1.25rem;
    --eh-font-size-2xl: 1.5rem;
    --eh-font-size-3xl: 1.875rem;

    /* Header */
    --eh-header-bg: var(--eh-theme);
}

/* ============================================
   RESET & BASE
   ============================================ */
.eh-checkout * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.eh-checkout {
    font-family: var(--eh-font-sans);
    font-size: var(--eh-font-size-base);
    line-height: 1.5;
    color: var(--eh-gray-900);
    background: var(--eh-gray-50);
}

/* ============================================
   CHECKOUT HEADER
   ============================================ */
.eh-checkout-header {
    position: relative;
    padding: var(--eh-spacing-2xl) var(--eh-spacing-lg);
    color: white;
    overflow: hidden;
}

.eh-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.eh-header-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.eh-header-logo {
    margin-bottom: var(--eh-spacing-lg);
}

.eh-header-logo img {
    height: 60px;
    width: auto;
}

.eh-header-title {
    font-size: var(--eh-font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--eh-spacing-md);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.eh-header-description {
    font-size: var(--eh-font-size-lg);
    margin-bottom: var(--eh-spacing-lg);
    opacity: 0.95;
}

.eh-header-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--eh-spacing-lg);
    margin-bottom: var(--eh-spacing-lg);
}

.eh-header-meta-item {
    display: flex;
    align-items: center;
    gap: var(--eh-spacing-sm);
    font-size: var(--eh-font-size-sm);
}

.eh-header-socials {
    display: flex;
    justify-content: center;
    gap: var(--eh-spacing-md);
    margin-top: var(--eh-spacing-xl);
}

.eh-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.2s;
}

.eh-social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.eh-checkout-main {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--eh-spacing-2xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--eh-spacing-2xl) var(--eh-spacing-lg);
}

.eh-checkout-content {
    min-width: 0;
}

.eh-checkout-sidebar {
    position: relative;
}

@media (max-width: 1024px) {
    .eh-checkout-main {
        grid-template-columns: 1fr;
    }

    .eh-checkout-sidebar {
        order: -1;
    }
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.eh-progress-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--eh-spacing-2xl);
    padding: var(--eh-spacing-lg);
    background: white;
    border-radius: var(--eh-radius-lg);
    box-shadow: var(--eh-shadow-sm);
}

.eh-progress-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: default;
}

.eh-progress-step.eh-clickable {
    cursor: pointer;
}

.eh-step-indicator {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--eh-gray-200);
    color: var(--eh-gray-500);
    margin-bottom: var(--eh-spacing-md);
    transition: all 0.3s;
}

.eh-progress-step.eh-current .eh-step-indicator {
    background: var(--eh-primary-lightest);
    color: var(--eh-primary);
    border: 2px solid var(--eh-primary);
}

.eh-progress-step.eh-completed .eh-step-indicator {
    background: var(--eh-primary);
    color: white;
}

.eh-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.eh-step-label {
    text-align: center;
    font-size: var(--eh-font-size-sm);
    font-weight: 500;
    color: var(--eh-gray-600);
}

.eh-progress-step.eh-current .eh-step-label,
.eh-progress-step.eh-completed .eh-step-label {
    color: var(--eh-gray-900);
    font-weight: 600;
}

.eh-step-connector {
    position: absolute;
    top: 28px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--eh-gray-300);
    z-index: -1;
}

.eh-step-connector.eh-completed {
    background: var(--eh-primary);
}

/* ============================================
   TICKET SELECTOR
   ============================================ */
.eh-ticket-selector {
    background: white;
    border-radius: var(--eh-radius-lg);
    padding: var(--eh-spacing-xl);
    box-shadow: var(--eh-shadow-sm);
}

.eh-ticket-selector-header h2 {
    font-size: var(--eh-font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--eh-spacing-md);
}

.eh-limit-one-notice {
    display: flex;
    align-items: center;
    gap: var(--eh-spacing-sm);
    padding: var(--eh-spacing-md);
    background: var(--eh-warning);
    color: white;
    border-radius: var(--eh-radius-md);
    font-size: var(--eh-font-size-sm);
    margin-bottom: var(--eh-spacing-lg);
}

.eh-tickets-list {
    display: flex;
    flex-direction: column;
    gap: var(--eh-spacing-lg);
}

/* Ticket Category */
.eh-ticket-category {
    margin-bottom: var(--eh-spacing-xl);
}

.eh-category-title {
    font-size: var(--eh-font-size-xl);
    font-weight: 600;
    margin-bottom: var(--eh-spacing-lg);
    padding-bottom: var(--eh-spacing-sm);
    border-bottom: 2px solid var(--eh-gray-200);
}

.eh-category-tickets {
    display: flex;
    flex-direction: column;
    gap: var(--eh-spacing-lg);
}

/* Ticket Card */
.eh-ticket-card {
    display: flex;
    gap: var(--eh-spacing-lg);
    padding: var(--eh-spacing-lg);
    border: 2px solid var(--eh-gray-200);
    border-radius: var(--eh-radius-lg);
    background: white;
    transition: all 0.2s;
}

.eh-ticket-card:hover {
    border-color: var(--eh-primary-light);
    box-shadow: var(--eh-shadow-md);
}

.eh-ticket-card.eh-selected {
    border-color: var(--eh-primary);
    background: var(--eh-primary-lightest);
}

.eh-ticket-card.eh-sold-out {
    opacity: 0.6;
    pointer-events: none;
}

.eh-ticket-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--eh-radius-md);
    overflow: hidden;
}

.eh-ticket-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eh-ticket-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.eh-ticket-header {
    display: flex;
    align-items: flex-start;
    gap: var(--eh-spacing-sm);
    margin-bottom: var(--eh-spacing-sm);
    flex-wrap: wrap;
}

.eh-ticket-title {
    flex: 1;
    font-size: var(--eh-font-size-lg);
    font-weight: 600;
    color: var(--eh-gray-900);
}

.eh-ticket-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--eh-radius-md);
    font-size: var(--eh-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.eh-badge-type {
    background: var(--eh-gray-200);
    color: var(--eh-gray-700);
}

.eh-badge-discount {
    background: var(--eh-success);
    color: white;
}

.eh-badge-soldout {
    background: var(--eh-error);
    color: white;
}

.eh-ticket-description {
    font-size: var(--eh-font-size-sm);
    color: var(--eh-gray-600);
    margin-bottom: var(--eh-spacing-md);
}

.eh-ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.eh-ticket-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.eh-price-original {
    font-size: var(--eh-font-size-sm);
    color: var(--eh-gray-500);
    text-decoration: line-through;
}

.eh-price-discounted,
.eh-price-current {
    font-size: var(--eh-font-size-xl);
    font-weight: 700;
    color: var(--eh-primary);
}

.eh-ticket-remaining {
    font-size: var(--eh-font-size-xs);
    color: var(--eh-warning);
    font-weight: 600;
}

/* Quantity Controls */
.eh-ticket-quantity {
    display: flex;
    align-items: center;
    gap: var(--eh-spacing-md);
}

.eh-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--eh-primary);
    border-radius: var(--eh-radius-md);
    background: white;
    color: var(--eh-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.eh-qty-btn:hover:not(:disabled) {
    background: var(--eh-primary);
    color: white;
}

.eh-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eh-qty-display {
    font-size: var(--eh-font-size-lg);
    font-weight: 700;
    min-width: 2rem;
    text-align: center;
}

.eh-ticket-selector-footer {
    margin-top: var(--eh-spacing-xl);
    padding-top: var(--eh-spacing-xl);
    border-top: 2px solid var(--eh-gray-200);
}

/* ============================================
   ORDER SUMMARY
   ============================================ */
.eh-order-summary {
    position: sticky;
    top: var(--eh-spacing-lg);
    background: white;
    border-radius: var(--eh-radius-lg);
    padding: var(--eh-spacing-xl);
    box-shadow: var(--eh-shadow-lg);
}

.eh-summary-title {
    font-size: var(--eh-font-size-xl);
    font-weight: 700;
    margin-bottom: var(--eh-spacing-lg);
    padding-bottom: var(--eh-spacing-md);
    border-bottom: 2px solid var(--eh-gray-200);
}

/* Empty State */
.eh-summary-empty {
    text-align: center;
    padding: var(--eh-spacing-2xl) var(--eh-spacing-lg);
    color: var(--eh-gray-500);
}

.eh-empty-icon {
    margin: 0 auto var(--eh-spacing-lg);
    opacity: 0.3;
}

/* Selected Tickets */
.eh-summary-tickets {
    margin-bottom: var(--eh-spacing-lg);
}

.eh-summary-ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--eh-spacing-md);
    padding: var(--eh-spacing-md);
    border-bottom: 1px solid var(--eh-gray-200);
}

.eh-ticket-info {
    display: flex;
    gap: var(--eh-spacing-md);
    flex: 1;
}

.eh-ticket-thumb {
    width: 50px;
    height: 50px;
    border-radius: var(--eh-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.eh-ticket-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eh-ticket-details h4 {
    font-size: var(--eh-font-size-sm);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.eh-ticket-qty,
.eh-ticket-price {
    font-size: var(--eh-font-size-xs);
    color: var(--eh-gray-600);
}

.eh-price-strike {
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.eh-price-discount {
    color: var(--eh-success);
    font-weight: 600;
}

.eh-ticket-total {
    font-weight: 700;
    color: var(--eh-gray-900);
}

/* Summary Sections */
.eh-summary-section {
    padding: var(--eh-spacing-lg) 0;
    border-bottom: 1px solid var(--eh-gray-200);
}

/* Coupon */
.eh-coupon-section {
    padding: var(--eh-spacing-lg) 0;
}

.eh-applied-coupons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eh-spacing-sm);
    margin-bottom: var(--eh-spacing-md);
}

.eh-coupon-tag {
    display: flex;
    align-items: center;
    gap: var(--eh-spacing-sm);
    padding: 0.5rem var(--eh-spacing-md);
    background: var(--eh-success);
    color: white;
    border-radius: var(--eh-radius-md);
    font-size: var(--eh-font-size-sm);
}

.eh-coupon-remove {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    opacity: 0.8;
}

.eh-coupon-remove:hover {
    opacity: 1;
}

.eh-coupon-input-wrapper {
    display: flex;
    gap: var(--eh-spacing-sm);
}

.eh-coupon-input {
    flex: 1;
}

/* Price Breakdown */
.eh-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--eh-spacing-sm) 0;
    font-size: var(--eh-font-size-sm);
}

.eh-price-row.eh-discount {
    color: var(--eh-success);
}

.eh-price-row.eh-total {
    font-size: var(--eh-font-size-lg);
    font-weight: 700;
    padding-top: var(--eh-spacing-md);
    margin-top: var(--eh-spacing-md);
    border-top: 2px solid var(--eh-gray-300);
}

.eh-tax-breakdown {
    padding-left: var(--eh-spacing-lg);
    margin-top: var(--eh-spacing-sm);
}

.eh-tax-item {
    display: flex;
    justify-content: space-between;
    font-size: var(--eh-font-size-xs);
    color: var(--eh-gray-600);
    padding: 0.25rem 0;
}

/* Summary Actions */
.eh-summary-action {
    margin-top: var(--eh-spacing-lg);
}

.eh-summary-terms {
    margin-top: var(--eh-spacing-lg);
    padding-top: var(--eh-spacing-lg);
    border-top: 1px solid var(--eh-gray-200);
}

.eh-summary-terms .eh-checkbox-label {
    display: block;
    margin-bottom: var(--eh-spacing-md);
}

/* ============================================
   FORMS
   ============================================ */
.eh-form-section-title {
    display: flex;
    align-items: center;
    gap: var(--eh-spacing-md);
    font-size: var(--eh-font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--eh-spacing-sm);
}

.eh-form-description {
    color: var(--eh-gray-600);
    margin-bottom: var(--eh-spacing-xl);
}

.eh-buyer-form-section,
.eh-attendee-forms-section {
    background: white;
    border-radius: var(--eh-radius-lg);
    padding: var(--eh-spacing-xl);
    box-shadow: var(--eh-shadow-sm);
    margin-bottom: var(--eh-spacing-xl);
}

.eh-dynamic-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--eh-spacing-lg);
}

/* Attendee Forms */
.eh-attendee-forms-list {
    display: flex;
    flex-direction: column;
    gap: var(--eh-spacing-lg);
}

.eh-attendee-form-card {
    border: 2px solid var(--eh-gray-200);
    border-radius: var(--eh-radius-lg);
    padding: var(--eh-spacing-lg);
    background: var(--eh-gray-50);
}

.eh-attendee-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--eh-spacing-lg);
    padding-bottom: var(--eh-spacing-md);
    border-bottom: 2px solid var(--eh-gray-200);
}

.eh-attendee-form-header h4 {
    font-size: var(--eh-font-size-lg);
    font-weight: 600;
}

.eh-attendee-ticket-badge {
    width: 40px;
    height: 40px;
    border-radius: var(--eh-radius-sm);
    overflow: hidden;
}

.eh-attendee-ticket-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Form Fields */
.eh-form-field {
    display: flex;
    flex-direction: column;
    gap: var(--eh-spacing-sm);
}

.eh-field-label {
    font-size: var(--eh-font-size-sm);
    font-weight: 600;
    color: var(--eh-gray-700);
}

.eh-required {
    color: var(--eh-error);
    margin-left: 0.25rem;
}

.eh-input,
.eh-textarea,
.eh-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--eh-gray-300);
    border-radius: var(--eh-radius-md);
    font-size: var(--eh-font-size-base);
    transition: all 0.2s;
}

.eh-input:focus,
.eh-textarea:focus,
.eh-select:focus {
    outline: none;
    border-color: var(--eh-primary);
    box-shadow: 0 0 0 3px var(--eh-primary-lightest);
}

.eh-textarea {
    resize: vertical;
    min-height: 100px;
}

.eh-field-hint {
    font-size: var(--eh-font-size-xs);
    color: var(--eh-gray-500);
}

.eh-field-error {
    font-size: var(--eh-font-size-sm);
    color: var(--eh-error);
    margin-top: var(--eh-spacing-xs);
}

.eh-field-invalid .eh-input,
.eh-field-invalid .eh-textarea,
.eh-field-invalid .eh-select {
    border-color: var(--eh-error);
}

/* Checkbox & Radio */
.eh-checkbox-label,
.eh-radio-label {
    display: flex;
    align-items: center;
    gap: var(--eh-spacing-sm);
    cursor: pointer;
    font-size: var(--eh-font-size-sm);
}

.eh-checkbox-group,
.eh-radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--eh-spacing-md);
}

/* Special Field Types */
.eh-field-title {
    grid-column: 1 / -1;
}

.eh-field-title-text {
    font-size: var(--eh-font-size-xl);
    font-weight: 700;
    color: var(--eh-gray-900);
    padding-bottom: var(--eh-spacing-sm);
    border-bottom: 2px solid var(--eh-gray-200);
}

.eh-field-info {
    grid-column: 1 / -1;
}

.eh-info-box {
    display: flex;
    align-items: flex-start;
    gap: var(--eh-spacing-md);
    padding: var(--eh-spacing-md);
    background: var(--eh-info);
    color: white;
    border-radius: var(--eh-radius-md);
}

.eh-field-html {
    grid-column: 1 / -1;
}

.eh-field-line {
    grid-column: 1 / -1;
}

.eh-field-line hr {
    border: none;
    border-top: 2px solid var(--eh-gray-200);
}

/* ============================================
   BUTTONS
   ============================================ */
.eh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--eh-spacing-sm);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--eh-radius-md);
    font-size: var(--eh-font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.eh-btn-primary {
    background: var(--eh-primary);
    color: white;
}

.eh-btn-primary:hover:not(:disabled) {
    background: var(--eh-primary-darker);
}

.eh-btn-secondary {
    background: var(--eh-gray-200);
    color: var(--eh-gray-800);
}

.eh-btn-secondary:hover:not(:disabled) {
    background: var(--eh-gray-300);
}

.eh-btn-lg {
    padding: 1rem 2rem;
    font-size: var(--eh-font-size-lg);
}

.eh-btn-block {
    width: 100%;
}

.eh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.eh-icon-right {
    margin-left: var(--eh-spacing-sm);
}

/* Step Actions */
.eh-step-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--eh-spacing-lg);
    margin-top: var(--eh-spacing-2xl);
}

/* ============================================
   UTILITIES
   ============================================ */
.eh-icon {
    flex-shrink: 0;
}

.eh-error-message {
    padding: var(--eh-spacing-lg);
    background: var(--eh-error);
    color: white;
    border-radius: var(--eh-radius-md);
    margin-bottom: var(--eh-spacing-lg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .eh-checkout-header {
        padding: var(--eh-spacing-xl) var(--eh-spacing-md);
    }

    .eh-header-title {
        font-size: var(--eh-font-size-2xl);
    }

    .eh-checkout-main {
        padding: var(--eh-spacing-lg) var(--eh-spacing-md);
        gap: var(--eh-spacing-lg);
    }

    .eh-progress-indicator {
        flex-direction: column;
        align-items: stretch;
    }

    .eh-step-connector {
        display: none;
    }

    .eh-ticket-card {
        flex-direction: column;
    }

    .eh-ticket-thumbnail {
        width: 100%;
        height: 200px;
    }

    .eh-dynamic-form {
        grid-template-columns: 1fr;
    }

    .eh-step-actions {
        flex-direction: column;
    }

    .eh-order-summary {
        position: static;
    }
}
