/* Import Premium Font from Google */
/* Use theme variables where available, fall back to plugin tokens */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --cp-font-primary: var(--font-primary, 'Space Grotesk');
    --cp-font-secondary: var(--font-secondary, system-ui, -apple-system, sans-serif);

    --cp-font-primary: "BC Falster Grotesk", sans-serif;
    --cp-font-secondary: "Geist", sans-serif;

    --cp-bg-main: var(--color-dark, #0B0F19);
    --cp-card-bg: rgba(22, 28, 45, 0.7);
    --cp-card-border: rgba(255, 255, 255, 0.08);
    --cp-text-primary: var(--color-white, #F3F4F6);
    --cp-text-secondary: var(--color-white, #ffffff);
    --cp-accent: var(--color-accent-blue, #6366F1);
    --cp-accent-hover: #4F46E5;
    --cp-success: #10B981;
    --cp-success-bg: rgba(16, 185, 129, 0.15);
    --cp-error: #EF4444;
    --cp-error-bg: rgba(239, 68, 68, 0.15);
    --cp-warning: #F59E0B;
    --cp-warning-bg: rgba(245, 158, 11, 0.15);
    --cp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.amelia-cp-wrapper {
    font-family: var(--cp-font-primary, 'Space Grotesk'), system-ui, -apple-system, sans-serif;
    color: var(--cp-text-primary);
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: none;
}

.amelia-cp-container {
    font-family: var(--cp-font-primary, 'Space Grotesk'), system-ui, -apple-system, sans-serif;
    color: var(--cp-text-primary);
    background: #fcffe8;
    padding: 30px;
    border-radius: 12px;
    margin: 0;
    position: relative;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: none;
}

/* Background Gradients *
.amelia-cp-container::before,
.amelia-cp-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Reset child elements z-index */
.amelia-cp-header,
.amelia-cp-main,
.amelia-cp-login-card {
    position: relative;
    z-index: 1;
}

/* Header */
.amelia-cp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--cp-card-border);
    padding-bottom: 24px;
    margin-bottom: 30px;
}

.amelia-cp-header-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.amelia-cp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #005c63;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.amelia-cp-welcome {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #005c63;
}

.amelia-cp-email {
    color: #005c63;
    font-size: 14px;
    margin: 0;
}

.amelia-cp-phone {
    color: #005c63;
}

/* Buttons */
.amelia-cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--cp-transition);
    border: none;
    outline: none;
    font-family: var(--font-secondary, 'Space Grotesk'), system-ui, -apple-system, sans-serif;
}

.amelia-cp-btn.btn-primary {
    background-color: #f9be5c;
    border: 1px solid #f9be5c;
    color: #000;
}

.amelia-cp-btn.btn-primary:hover:not(:disabled) {
    background-color: #005983;
    color: #c1edb1;
    border: 1px solid #c1edb1;
}

.amelia-cp-btn.btn-secondary {
    background-color: #f9be5c;
    color: #000;
    border-radius: 20px !important;
    padding: 10px 20px !important;
    height: 40px;
    font-size: 14px !important;
}

.amelia-cp-btn.btn-secondary:hover {
    background: #005983;
    color: #c1edb1;
}

.amelia-cp-btn.btn-outline {
    background-color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #EF4444;
}

.amelia-cp-btn.btn-outline:hover:not(:disabled) {
    background-color: #fff;
    transform: translateY(-2px);
}

.amelia-cp-btn.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
}

.amelia-cp-btn.btn-block {
    width: 100%;
}

/* Alert Boxes */
.amelia-cp-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    border-left: 4px solid transparent;
    line-height: 20px;
}

.alert-success {
    background-color: var(--cp-success-bg);
    border-color: var(--cp-success);
    color: var(--cp-success);
}

.alert-error {
    background-color: var(--cp-error-bg);
    border-color: var(--cp-error);
    color: var(--cp-error);
}

/* Sections */
.amelia-cp-section {
    margin-bottom: 40px;
}

.amelia-cp-section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #005c63;
    border-left: 3px solid #005c63;
    padding-left: 12px;
}

/* Grid & Cards */
.amelia-cp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.amelia-cp-card {
    background-color: #005c63;
    border: 1px solid var(--cp-card-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    transition: var(--cp-transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0;
}

.amelia-cp-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.amelia-cp-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.event-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #FFF;
}

.event-meta-info {
    font-size: 14px;
    color: var(--cp-text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cost-item {
    font-size: 15px;
    margin-top: 6px;
    color: var(--cp-text-primary);
}

.paid-item {
    color: #c1edb1;
    font-size: 15px;
}

.coupon-item {
    color: #c1edb1;
    font-size: 13px;
}

.event-actions-bar {
    display: flex;
    gap: 12px;
}

.cancellation-warning-label {
    font-size: 12px;
    color: var(--cp-error);
    margin: 8px 0 0 0;
    text-align: center;
    background-color: #fff;
    padding: 4px;
    border-radius: 8px;
    font-weight: 500;
}

/* Badges */
.amelia-cp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 40px;
}

.badge-approved {
    background-color: var(--cp-success-bg);
    color: var(--cp-success);
}

.badge-canceled {
    background-color: #fff;
    color: var(--cp-error);
}

.badge-rebooked {
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--cp-accent);
}

.badge-pending {
    background-color: var(--cp-warning-bg);
    color: var(--cp-warning);
}

.badge-paid {
    background-color: rgba(99, 102, 241, 0.2);
    color: #818CF8;
}

/* Grid Muted (Past Bookings) */
.grid-muted {
    opacity: 1;
}

.grid-muted .amelia-cp-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--cp-card-border);
}

.past-date {
    margin: 0;
    font-size: 13px;
    color: var(--cp-text-secondary);
}

/* Popups & Modals */
.amelia-cp-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: var(--font-secondary);
}

.amelia-cp-modal-backdrop.open {
    display: flex;
    opacity: 1;
}

.amelia-cp-modal-card {
    background-color: #ebeddd;
    border: 1px solid var(--cp-card-border);
    width: 90%;
    max-width: 700px;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: var(--cp-font-primary, 'Space Grotesk'), system-ui, -apple-system, sans-serif;
}

.amelia-cp-modal-backdrop.open .amelia-cp-modal-card {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #005c63;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #005c63;
}

.modal-subtitle {
    color: #005c63;
    font-size: 14px;
    margin: 0 0 24px 0;
}

.amelia-cp-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.amelia-cp-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--cp-text-primary);
}

.amelia-cp-select,
.amelia-cp-form-group input {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    height: 40px;
    border: 1px solid #95cda7;
    outline: none;
    background-color: #fff;
    color: #000;
    font-family: var(--font-secondary);
    font-size: 16px;
    font-weight: 400;
    border-radius: 8px;
    padding: 0 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-secondary);
}

.amelia-cp-form-group input:-webkit-autofill,
.amelia-cp-form-group input:-webkit-autofill:hover,
.amelia-cp-form-group input:-webkit-autofill:focus,
.amelia-cp-form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: #000 !important;
    background-color: transparent !important;
    transition: background-color 99999s ease-in-out 0s;
}

.amelia-cp-select:focus,
.amelia-cp-form-group input:focus {
    border-color: #005983;
    box-shadow: none;
}

.amelia-cp-select option {
    background-color: #ebeddd;
    color: #0F172A;
}

#rebook-stripe-card-wrapper label {
    color: #005c63 !important;
}

#stripe-card-element {
    border: 1px solid #005c63 !important;
}

/* Loader */
.modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    color: #005c63;
    font-size: 14px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--cp-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Pricing summary card in modal */
.rebook-pricing-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cp-card-border);
    border-radius: 10px;
    padding: 16px 0;
    margin-bottom: 24px;
}

.pricing-card-title {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #005c63;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-row {
    font-size: 14px;
    color: #005c63;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pricing-row.row-total {
    font-size: 15px;
    font-weight: 600;
    color: #005c63;
    margin-top: 8px;
    margin-bottom: 0;
}

.pricing-divider {
    border-bottom: 1px solid var(--cp-card-border);
    margin: 12px 0;
}

.pricing-note {
    font-size: 11px;
    color: var(--cp-accent);
    margin-top: 8px;
}

.modal-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Empty states */
.amelia-cp-empty-card {
    background-color: #005983;
    border: 1px dashed var(--cp-card-border);
    border-radius: 12px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--cp-text-secondary);
    gap: 12px;
}

/* Login/Magic access card */
.amelia-cp-login-card {
    max-width: 420px;
    margin: 40px auto;
    background-color: #fcffe8;
    border: 1px solid var(--cp-card-border);
    border-radius: 16px;
    padding: 36px;
    text-align: center;
    box-shadow: none;
}

.amelia-cp-title {
    margin: 0;
    padding: 0 0 10px;
    color: #005c63;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 700;
    text-align: center;
}

.amelia-cp-divider {
    height: 3px;
    width: 60px;
    background-color: #005c63;
    margin: 0 auto 20px auto;
    border-radius: 20px;
}

.amelia-cp-subtitle {
    font-size: 14px;
    color: #005c63;
    line-height: 1.5;
    margin-bottom: 24px;
}

.amelia-cp-form-group label {
    text-align: left;
    margin-block-end: 4px;
    display: block;
    margin: 0 0 0;
    color: #005c63;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
}

/* Spin Keyframes */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    .amelia-cp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .amelia-cp-header a {
        align-self: flex-end;
    }

    .amelia-cp-container {
        padding: 16px;
    }

    .amelia-cp-modal-card {
        padding: 20px;
    }

    .amelia-cp-form-group {
        margin-bottom: 10px;
    }
}

.neil-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 61, 62, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.neil-confirm-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.neil-confirm-dialog {
    background: #ffffff;
    border-radius: 14px;
    padding: 28px;
    max-width: 380px;
    width: calc(100% - 40px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(12px) scale(0.96);
    transition: transform 0.2s ease;
    font-family: inherit;
}

.neil-confirm-overlay.is-visible .neil-confirm-dialog {
    transform: translateY(0) scale(1);
}

.neil-confirm-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f3d3e;
    margin: 0 0 10px;
}

.neil-confirm-message {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin: 0 0 24px;
}

.neil-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.neil-confirm-btn {
    border: none;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.neil-confirm-btn-cancel {
    background: #f1f1f1;
    color: #333;
}

.neil-confirm-btn-cancel:hover {
    background: #e5e5e5;
}

.neil-confirm-btn-ok {
    background: #0f3d3e;
    color: #fff;
}

.neil-confirm-btn-ok:hover {
    background: #0b2e2f;
}

.neil-confirm-btn-ok.is-danger {
    background: #c0392b;
}

.neil-confirm-btn-ok.is-danger:hover {
    background: #a5321f;
}

.neil-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 61, 62, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.neil-alert-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.neil-alert-dialog {
    background: #ffffff;
    border-radius: 14px;
    padding: 28px;
    max-width: 380px;
    width: calc(100% - 40px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(12px) scale(0.96);
    transition: transform 0.2s ease;
    font-family: inherit;
    text-align: center;
}

.neil-alert-overlay.is-visible .neil-alert-dialog {
    transform: translateY(0) scale(1);
}

.neil-alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0f3d3e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 20px;
}

.neil-alert-icon.is-error {
    background: #c0392b;
}

.neil-alert-message {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin: 0 0 24px;
}

.neil-alert-btn {
    border: none;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 28px;
    border-radius: 8px;
    cursor: pointer;
    background: #0f3d3e;
    color: #fff;
    transition: background 0.15s ease;
}

.neil-alert-btn:hover {
    background: #0b2e2f;
}

.neil-alert-btn.is-error {
    background: #c0392b;
}

.neil-alert-btn.is-error:hover {
    background: #a5321f;
}