/**
 * Lifeline Events Frontend Styles
 * 
 * Modern UI with Element Plus integration
 */

/* ===== ELEMENT PLUS INTEGRATION ===== */

/* Import Element Plus styles (if not already loaded) */
@import url('https://unpkg.com/element-plus/dist/index.css');

/* Custom Element Plus theme variables */
:root {
    --el-color-primary: #667eea;
    --el-color-primary-light-3: #8fa3f0;
    --el-color-primary-light-5: #b3c4f5;
    --el-color-primary-light-7: #d7e0fa;
    --el-color-primary-light-8: #e8effc;
    --el-color-primary-light-9: #f4f7fe;
    --el-color-primary-dark-2: #4c5fd8;
    --el-border-radius-base: 8px;
    --el-border-radius-small: 6px;
    --el-font-size-base: 14px;
    --el-font-size-small: 12px;
    --el-font-size-large: 16px;
}

/* ===== MODERN MODAL STYLES ===== */

/* Modal Overlay */
.lifeline-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

#lifeline-rsvp-modal {
    display: none !important;
}

/* Only show when it should be visible */
#lifeline-rsvp-modal.show {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Content */
.lifeline-modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 750px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.lifeline-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.lifeline-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.lifeline-modal-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lifeline-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lifeline-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modal Body */
.lifeline-modal-body {
    padding: 32px;
    max-height: calc(90vh - 88px);
    overflow-y: auto;
}

.el-input-number.is-controls-right .el-input-number__decrease {
    left: -20px !important;
    right: auto !important;
}

/* ===== MODERN TICKET PURCHASE STYLES ===== */

.lifeline-ticket-purchase-modern {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Loading Card */
.loading-card {
    text-align: center;
    padding: 60px 40px;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    color: var(--el-color-primary);
}

/* Error Messages */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    margin: 20px;
    font-size: 14px;
}

.error-message::before {
    content: "⚠️ ";
    margin-right: 8px;
}

/* Loading Spinner Animation */
.loading-spinner svg {
    /* animation: spin 1s; */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-content p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Error Card */
.error-card {
    padding: 24px;
}

/* Success Card */
.success-card {
    text-align: center;
    padding: 60px 40px;
}

.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.success-icon {
    width: 64px;
    height: 64px;
    color: #67c23a;
}

.success-content h4 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.success-content p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Step Cards */
.step-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.el-steps--simple {
    padding: 13px 4% !important;
}

.step-card .el-card__header {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-bottom: 1px solid #e8effc;
    padding: 24px 8px;
}

.step-header {
    margin: -8px 0;
}

.step-header .el-steps {
    --el-step-main-bg-color: #fff;
    --el-step-border-color: #e4e7ed;
    --el-step-finish-border-color: var(--el-color-primary);
    --el-step-finish-text-color: var(--el-color-primary);
    --el-step-process-text-color: var(--el-color-primary);
    --el-step-process-bg-color: var(--el-color-primary);
}

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

.event-info .el-descriptions {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.event-info .el-descriptions__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    margin: 0;
}

.event-info .el-descriptions__title {
    color: white;
    font-weight: 600;
    margin: 0;
}

/* Ticket Types */
.ticket-types {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.ticket-type-card {
    border: 2px solid #f0f4ff;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.ticket-type-card:hover {
    border-color: var(--el-color-primary);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.ticket-type-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    gap: 24px;
}

.ticket-info {
    flex: 1;
}

.ticket-info h5 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ticket-description {
    color: #666;
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.ticket-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ticket-quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.ticket-quantity label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

/* Ticket Summary */
.ticket-summary {
    margin-bottom: 32px;
}

.ticket-summary .el-card {
    border: 2px solid #f0f4ff;
    border-radius: 12px;
}

.ticket-summary .el-card__header {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-bottom: 1px solid #e8effc;
    padding: 16px 24px;
}

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

.total-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--el-color-primary);
}

/* Customer Form */
.customer-form {
    max-width: 500px;
    margin: 0 auto;
}

.customer-form .el-form-item {
    margin-bottom: 24px;
}

.customer-form .el-form-item__label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.customer-form .el-input {
    --el-input-border-radius: 8px;
}

.customer-form .el-input__wrapper {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #e4e7ed;
    transition: all 0.3s ease;
}

.customer-form .el-input__wrapper:hover {
    border-color: var(--el-color-primary);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.customer-form .el-input__wrapper.is-focus {
    border-color: var(--el-color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Payment Methods */
.payment-methods {
    margin-bottom: 32px;
}

.payment-methods h5 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.payment-options {
    display: flex;
    /* flex-direction: column; */
    gap: 12px;
}

.payment-methods .payment-options .el-radio {
    height: auto;
}

.payment-option {
    border: 2px solid #f0f4ff;
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.3s ease;
    margin: 0;
}

.payment-option:hover {
    border-color: var(--el-color-primary);
    background: #f8f9ff;
}

.payment-option.is-checked {
    border-color: var(--el-color-primary);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
}

.payment-option-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gateway-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.gateway-description {
    color: #666;
    font-size: 14px;
}

/* Order Summary */
.order-summary {
    margin-bottom: 32px;
}

.order-summary .el-card {
    border: 2px solid #f0f4ff;
    border-radius: 12px;
}

.order-summary .el-card__header {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-bottom: 1px solid #e8effc;
    padding: 16px 24px;
}

.order-summary h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f4ff;
}

.step-actions .el-button {
    min-width: 120px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.step-actions .el-button--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.step-actions .el-button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.step-actions .el-button--default {
    border: 2px solid #e4e7ed;
    background: white;
    color: #666;
}

.step-actions .el-button--default:hover {
    border-color: var(--el-color-primary);
    color: var(--el-color-primary);
    background: #f8f9ff;
}

.el-input-number input.el-input__inner {
    border: none !important;
}

.ticket-type-content .ticket-quantity .el-input-number--large {
    width: auto;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .lifeline-modal-overlay {
        padding: 10px;
    }

    .lifeline-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .lifeline-modal-header {
        padding: 20px 24px;
    }

    .lifeline-modal-header h3 {
        font-size: 1.5rem;
        color: #ffffff;
    }

    .lifeline-modal-body {
        padding: 24px;
    }

    .ticket-type-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .ticket-type-content .ticket-info h5 {
        color: #303133;
    }

    .ticket-types .ticket-type-card {
        border: 1px solid #409eff;
    }

    .ticket-quantity {
        align-items: flex-start;
        width: 100%;
    }

    .ticket-quantity .el-input-number input.el-input__inner {
        border: none;
    }

    .step-actions {
        flex-direction: column;
        gap: 12px;
    }

    .step-actions .el-button {
        width: 100%;
    }

    .payment-options {
        gap: 8px;
    }

    .payment-option {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .lifeline-modal-header {
        padding: 16px 20px;
    }

    .lifeline-modal-body {
        padding: 20px;
    }

    .ticket-type-card {
        margin: 0 -8px;
    }

    .ticket-type-content {
        padding: 20px;
    }

    .step-card .el-card__header {
        padding: 20px 24px;
    }

    .step-card .el-card__body {
        padding: 20px;
    }
}

/* ===== ANIMATIONS ===== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lifeline-ticket-purchase-modern .el-card {
    animation: slideInUp 0.4s ease-out;
}

.ticket-type-card {
    animation: fadeInScale 0.3s ease-out;
}

/* ===== ACCESSIBILITY ===== */

.lifeline-ticket-purchase-modern .el-button:focus,
.lifeline-ticket-purchase-modern .el-input__wrapper:focus-within {
    outline: 2px solid var(--el-color-primary);
    outline-offset: 2px;
}

/* ===== DARK MODE SUPPORT ===== */

@media (prefers-color-scheme: dark) {
    .lifeline-modal-content {
        /* background: #1a1a1a; */
        color: #fff;
    }

    .step-card {
        background: #2a2a2a;
        color: #fff;
    }

    .ticket-type-card {
        background: #2a2a2a;
        border-color: #404040;
    }

    .ticket-info h5 {
        color: #303133;
    }

    .ticket-description {
        color: #ccc;
    }
}

/* ===== LEGACY SUPPORT ===== */

/* Keep existing styles for backward compatibility */
.lifeline-ticket-purchase-container {
    /* Existing styles preserved */
}

/* ===== CUSTOM ELEMENT PLUS OVERRIDES ===== */

/* Override Element Plus default styles for better integration */
.lifeline-ticket-purchase-modern .el-card {
    --el-card-border-color: #409eff;
    --el-card-border-radius: 12px;
}

.lifeline-ticket-purchase-modern .el-button {
    --el-button-border-radius: 8px;
    --el-button-font-weight: 500;
}

.lifeline-ticket-purchase-modern .el-input {
    --el-input-border-radius: 8px;
}

.lifeline-ticket-purchase-modern .el-tag {
    --el-tag-border-radius: 6px;
}

.lifeline-ticket-purchase-modern .el-descriptions {
    --el-descriptions-item-bordered-label-background: #f8f9ff;
}

/* ===== PRINT STYLES ===== */

@media print {
    .lifeline-modal-overlay {
        position: static;
        background: none;
    }

    .lifeline-modal-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .step-actions {
        display: none;
    }
}

/* Basic Fallback Component */
.basic-ticket-purchase {
    padding: 40px 20px;
    text-align: center;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-state p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.retry-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}