/**
 * Cart Page - Modal Styles
 * Modern dark theme design
 */

/* ==========================================================================
   Modal Overlay & Container
   ========================================================================== */

.eai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eai-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.eai-modal-content {
    position: relative;
    background: #222128;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: eai-modal-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes eai-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.eai-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Modal Header
   ========================================================================== */

.eai-modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(0, 174, 239, 0.1) 0%, rgba(0, 113, 161, 0.05) 100%);
}

.eai-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.eai-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    padding: 8px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eai-modal-close:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.4);
    color: #ff6b6b;
    transform: rotate(90deg);
}

.eai-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Modal Body
   ========================================================================== */

.eai-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.eai-modal-description {
    margin: 0 0 24px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================================================
   Attendee Cards - Redesigned
   ========================================================================== */

.eai-attendees-forms {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eai-attendee-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.eai-attendee-card:hover {
    border-color: rgba(0, 174, 239, 0.3);
    box-shadow: 0 4px 20px rgba(0, 174, 239, 0.1);
}

.eai-attendee-card.expanded {
    border-color: rgba(0, 174, 239, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.eai-attendee-card.collapsed .eai-card-body {
    display: none;
}

.eai-card-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.eai-attendee-card.expanded .eai-card-header {
    background: linear-gradient(135deg, rgba(0, 174, 239, 0.15) 0%, rgba(0, 113, 161, 0.1) 100%);
    border-bottom-color: rgba(0, 174, 239, 0.2);
}

.eai-card-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.eai-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eai-attendee-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #00aeef 0%, #0071a1 100%);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    padding: 0 8px;
}

.eai-toggle-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    padding: 6px 10px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    border-radius: 6px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eai-toggle-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.eai-toggle-icon {
    display: inline-block;
    font-weight: 600;
    line-height: 1;
}

.eai-card-body {
    padding: 24px 20px;
}

/* ==========================================================================
   Form Elements - Modern Dark Design
   ========================================================================== */

.eai-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.eai-form-row:last-child {
    margin-bottom: 0;
}

.eai-form-group {
    flex: 1;
    min-width: 0;
}

.eai-form-group.eai-full-width {
    flex: 1 1 100%;
}

.eai-form-group.eai-half-width {
    flex: 1 1 calc(50% - 8px);
    min-width: 200px;
}

.eai-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    letter-spacing: 0.3px;
}

.eai-form-group label .required {
    color: #ff6b6b;
    font-weight: 700;
    margin-left: 2px;
}

.eai-input,
.eai-textarea {
    width: 100%;
    padding: 12px 14px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    background-color: #f9f9f9 !important;
    color: #333333 !important;
}

.eai-input::placeholder,
.eai-textarea::placeholder {
    color: rgba(51, 51, 51, 0.5) !important;
}

.eai-input:hover,
.eai-textarea:hover {
    background-color: #ffffff !important;
    border-color: #999 !important;
}

.eai-input:focus,
.eai-textarea:focus {
    outline: none !important;
    background-color: #ffffff !important;
    border-color: #007cba !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
}

/* Fix for autofill */
.eai-input:-webkit-autofill,
.eai-input:-webkit-autofill:hover,
.eai-input:-webkit-autofill:focus,
.eai-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #f9f9f9 inset !important;
    -webkit-text-fill-color: #333333 !important;
    caret-color: #333333 !important;
    border-radius: 8px !important;
}

.eai-textarea:-webkit-autofill,
.eai-textarea:-webkit-autofill:hover,
.eai-textarea:-webkit-autofill:focus,
.eai-textarea:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #f9f9f9 inset !important;
    -webkit-text-fill-color: #333333 !important;
    border-radius: 8px !important;
}

.eai-input:hover,
.eai-textarea:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.eai-input:focus,
.eai-textarea:focus {
    outline: none;
    border-color: #00aeef;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
}

.eai-input.error,
.eai-textarea.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.eai-input.error:focus,
.eai-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.eai-textarea {
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
}

/* ==========================================================================
   Modal Footer
   ========================================================================== */

.eai-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.eai-modal-footer .button {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.eai-modal-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.eai-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.eai-modal-save {
    background: linear-gradient(135deg, #00aeef 0%, #0071a1 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.3);
}

.eai-modal-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 174, 239, 0.4);
}

.eai-modal-save:active {
    transform: translateY(0);
}

.eai-modal-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Modal Messages
   ========================================================================== */

.eai-modal-messages {
    padding: 0 30px 20px;
}

.eai-modal-messages .eai-error,
.eai-modal-messages .eai-success {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 0;
    font-weight: 500;
    border-left: 4px solid;
}

.eai-modal-messages .eai-error {
    background: rgba(255, 107, 107, 0.15);
    border-color: #ff6b6b;
    color: #ff9999;
}

.eai-modal-messages .eai-success {
    background: rgba(46, 213, 115, 0.15);
    border-color: #2ed573;
    color: #6fff9f;
}

/* ==========================================================================
   Cart Attendee Button
   ========================================================================== */

.eai-cart-attendee-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eai-cart-attendee-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.eai-cart-attendee-btn.incomplete {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    color: #ffd93d;
}

.eai-cart-attendee-btn.incomplete:hover {
    background: rgba(255, 193, 7, 0.25);
    border-color: rgba(255, 193, 7, 0.6);
}

.eai-cart-attendee-btn.complete {
    background: rgba(46, 213, 115, 0.15);
    border-color: rgba(46, 213, 115, 0.4);
    color: #6fff9f;
}

.eai-cart-attendee-btn.complete:hover {
    background: rgba(46, 213, 115, 0.25);
    border-color: rgba(46, 213, 115, 0.6);
}

.eai-cart-attendee-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .eai-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .eai-modal-header,
    .eai-modal-body,
    .eai-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .eai-modal-header h3 {
        font-size: 18px;
    }
    
    .eai-modal-footer {
        flex-direction: column-reverse;
    }
    
    .eai-modal-footer .button {
        width: 100%;
    }
    
    .eai-form-group.eai-half-width {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .eai-modal-content {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        width: 100%;
    }
    
    .eai-cart-attendee-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .eai-card-body {
        padding: 20px 16px;
    }
}

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */

.eai-modal-body::-webkit-scrollbar {
    width: 8px;
}

.eai-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.eai-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.eai-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.eai-modal-save.loading {
    position: relative;
    color: transparent;
}

.eai-modal-save.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: eai-spin 0.6s linear infinite;
}

@keyframes eai-spin {
    to { transform: rotate(360deg); }
}

