/**
 * Zacatrus Events Styles
 *
 * @category    Zacatrus
 * @package     Zacatrus_Events
 * @author      Zacatrus
 */

.zacatrus-events-list {
    --evt-blue: #0074bd;
    --evt-blue-dark: #005f9d;
    --evt-grey: #f3f3f3;
    --evt-grey-2: #f7f7f7;
    --evt-border: #e0e0e0;
    --evt-text: #000;
    --evt-muted: #555;
    --evt-green: #e7f5e5;
    --evt-green-text: #24702b;
    --evt-orange: #fff1d8;
    --evt-orange-text: #975000;
    width: 100%;
    margin: 0;
    padding: 28px 0;
    color: var(--evt-text);
    font-size: 14px;
}

.zacatrus-events-list *,
.zacatrus-events-list *::before,
.zacatrus-events-list *::after {
    box-sizing: border-box;
}

/* Disabled module notice */
.events-disabled-message {
    padding: 2rem 1rem;
    background: #fff3cd;
    border-top: 1px solid #ffc107;
    border-bottom: 1px solid #ffc107;
}

.events-disabled-message .message {
    margin: 0 auto;
    border-radius: 4px;
    background: transparent;
    border: none;
}

@media (min-width: 768px) {
    .events-disabled-message {
        padding: 3rem 2rem;
    }
}

/* Hero */
.events-hero {
    margin-bottom: 18px;
    padding: 30px;
    border: 1px solid #e7e7e7;
    border-radius: 28px;
    background: var(--evt-grey);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
}

.events-hero-text {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 24px;
}

.events-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--evt-blue);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.events-hero-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--evt-text);
}

.events-hero-intro {
    max-width: 560px;
    margin: 12px auto 0;
    color: var(--evt-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Filter panel */
.events-filter-panel {
    padding: 16px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.events-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.events-field {
    position: relative;
    display: block;
}

.events-field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--evt-blue);
    pointer-events: none;
    font-size: 14px;
}

.events-field select {
    width: 100%;
    height: 48px;
    border: 1px solid #d7d7d7;
    border-radius: 999px;
    background: #fafafa;
    color: var(--evt-text);
    font: 14px Arial, Helvetica, sans-serif;
    outline: 0;
    padding: 0 16px 0 44px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    appearance: none;
    -webkit-appearance: none;
}

.events-field select:focus {
    border-color: var(--evt-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 116, 189, 0.10);
}

.events-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
}

.events-count {
    display: inline-flex;
    border-radius: 999px;
    background: var(--evt-grey);
    padding: 9px 16px;
    font-weight: 700;
}

.events-clear-btn {
    border: 1px solid #000;
    background: #fff;
    color: #000;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.events-clear-btn:hover,
.events-clear-btn:focus {
    background: #000;
    color: #fff;
    text-decoration: none;
}

/* "My events" toggle (kept between filters and grid) */
.my-events-toggle-wrapper {
    margin: 18px 0;
    text-align: center;
}

.my-events-chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d7d7d7;
    color: var(--evt-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.my-events-chip:hover,
.my-events-chip:focus {
    border-color: var(--evt-blue);
    color: var(--evt-blue);
    text-decoration: none;
}

.my-events-chip.active {
    background: var(--evt-blue);
    border-color: var(--evt-blue);
    color: #fff;
}

.my-events-chip.active:hover,
.my-events-chip.active:focus {
    background: var(--evt-blue-dark);
    border-color: var(--evt-blue-dark);
    color: #fff;
}

/* Events wrap + grid */
.events-wrap {
    padding: 22px;
    border: 1px solid #e7e7e7;
    border-radius: 28px;
    background: var(--evt-grey);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* Cards */
.event-card {
    overflow: hidden;
    border: 1px solid var(--evt-border);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.10);
}

.event-card-head {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.event-tag {
    display: inline-flex;
    padding: 6px 11px;
    border-radius: 999px;
    background: #f1f1f1;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.event-tag-main {
    background: #eef6fc;
    color: var(--evt-blue);
}

.event-tag-recurrence {
    background: #fff;
    color: #555;
    border: 1px dashed #bbb;
}

.event-card-title {
    margin: 0;
    min-height: 44px;
    font-size: 18px;
    line-height: 1.22;
    letter-spacing: -0.01em;
    color: var(--evt-text);
}

.event-card-title-link,
.event-card-title-link:visited {
    color: inherit;
    text-decoration: none;
}

.event-card-title-link:hover,
.event-card-title-link:focus {
    color: var(--evt-blue);
    text-decoration: none;
}

.event-availability {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.event-availability-available {
    background: var(--evt-green);
    color: var(--evt-green-text);
}

.event-availability-last {
    background: var(--evt-orange);
    color: var(--evt-orange-text);
}

.event-availability-full {
    background: #000;
    color: #fff;
}

.event-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.event-card-desc {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--evt-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-card-meta {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 13px;
    border-radius: 16px;
    background: var(--evt-grey-2);
    font-size: 13px;
}

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

.event-meta-icon {
    color: var(--evt-blue);
    font-weight: 700;
}

.event-info-link {
    color: var(--evt-blue);
    text-decoration: underline;
    font-weight: 500;
}

.event-info-link:hover,
.event-info-link:focus {
    color: var(--evt-blue-dark);
}

.event-registration-status {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f7f9fc;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.status-confirmed {
    color: #155724;
}

.status-waitlist {
    color: #856404;
}

.event-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
}

.event-card-actions-secondary {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr;
}

.event-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 999px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    line-height: 1.2;
    min-height: 38px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.event-action-details {
    background: #fff;
    color: #000;
    border-color: #000;
}

.event-action-details:hover,
.event-action-details:focus {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.event-action-primary {
    background: var(--evt-blue);
    color: #fff;
    border-color: var(--evt-blue);
    box-shadow: 0 2px 8px rgba(0, 116, 189, 0.20);
}

.event-action-primary:hover,
.event-action-primary:focus {
    background: var(--evt-blue-dark);
    border-color: var(--evt-blue-dark);
    color: #fff;
    text-decoration: none;
}

.event-action-secondary {
    background: #fff;
    color: var(--evt-blue);
    border-color: var(--evt-blue);
}

.event-action-secondary:hover,
.event-action-secondary:focus {
    background: var(--evt-blue);
    color: #fff;
    text-decoration: none;
}

.event-action-danger {
    background: #fff;
    color: #b00020;
    border-color: #b00020;
}

.event-action-danger:hover,
.event-action-danger:focus {
    background: #b00020;
    color: #fff;
    text-decoration: none;
}

.event-action.waitlist-btn {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
    box-shadow: none;
}

.event-action.waitlist-btn:hover,
.event-action.waitlist-btn:focus {
    background: #e0a800;
    border-color: #e0a800;
    color: #212529;
}

.event-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.event-card-extras {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 12px;
}

/* Inline AJAX messages prepended into a card by event-registration.js */
.event-card > .message {
    margin: 0;
    padding: 14px 18px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.4;
    border: 0;
    border-radius: 0;
}

.event-card > .message.success {
    background: var(--evt-green);
    color: var(--evt-green-text);
}

.event-card > .message.error {
    background: #fde7e9;
    color: #b00020;
}

.event-card > .message.info {
    background: #e7f1fb;
    color: var(--evt-blue-dark);
}

/* Loading state (preserved class names so JS hooks keep working) */
.event-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.event-card.loading .event-action {
    position: relative;
}

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

/* Empty state */
.events-empty {
    border-radius: 22px;
    background: #fff;
    padding: 36px 22px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.events-empty h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.events-empty p {
    max-width: 420px;
    margin: 10px auto 18px;
    line-height: 1.5;
    color: var(--evt-muted);
}

.events-empty-cta {
    display: inline-block;
    background: var(--evt-blue);
    color: #fff;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 116, 189, 0.20);
    transition: background 0.18s ease;
}

.events-empty-cta:hover,
.events-empty-cta:focus {
    background: var(--evt-blue-dark);
    color: #fff;
    text-decoration: none;
}

/* Event detail page */
.event-view-page {
    width: 100%;
    margin: 0;
    padding: 28px 0;
}

.event-view-back {
    margin-bottom: 18px;
}

.event-view-back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid #000;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.event-view-back a:hover,
.event-view-back a:focus {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.event-view-card {
    border: 1px solid #e7e7e7;
    border-radius: 28px;
    background: #fff;
    padding: 32px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
}

.event-view-card .event-tags {
    margin-bottom: 16px;
}

.event-view-title {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.event-view-card .event-availability {
    margin-top: 0;
    margin-bottom: 18px;
}

.event-view-meta {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 20px;
    background: var(--evt-grey-2);
    font-size: 14px;
}

.event-view-meta > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-view-meta .event-meta-icon {
    color: var(--evt-blue);
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.event-view-description {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--evt-text);
}

.event-view-description :first-child {
    margin-top: 0;
}

.event-view-description :last-child {
    margin-bottom: 0;
}

.event-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.event-view-actions .event-action {
    flex: 0 0 auto;
    padding-left: 18px;
    padding-right: 18px;
    min-height: 42px;
    font-size: 13px;
}

.event-view-extras {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eee;
    font-size: 13px;
}

/* Responsive */
@media (min-width: 1400px) {
    .events-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .events-controls,
    .events-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .zacatrus-events-list {
        padding: 16px 10px;
    }
    .events-hero,
    .events-wrap {
        border-radius: 22px;
        padding: 18px;
    }
    .events-hero-title {
        font-size: 26px;
    }
    .events-controls,
    .events-grid {
        grid-template-columns: 1fr;
    }
    .events-summary {
        align-items: flex-start;
        flex-direction: column;
    }
    .event-card-actions {
        grid-template-columns: 1fr;
    }
    .events-details-actions {
        flex-direction: column;
    }
    .events-details-actions .events-details-primary,
    .events-details-actions .events-details-close-btn {
        width: 100%;
        text-align: center;
    }
}

/* === Untouched legacy sections below === */

/* Event View Page */
.event-view-page {
    max-width: 800px;
    margin: 0 auto;
}

.event-back-link {
    margin-bottom: 1.5rem;
}

.event-back-link .back-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.event-back-link .back-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.event-card-detailed {
    max-width: 100%;
}

.event-card-detailed .event-name {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.event-card-detailed .event-description {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.event-card-detailed .description-content {
    margin-top: 0.5rem;
    line-height: 1.8;
}

@media (min-width: 768px) {
    .event-card-detailed .event-name {
        font-size: 2.5rem;
    }
}

/* Phone Modal Styles */
.phone-modal {
    display: none;
}

.phone-modal .phone-form {
    padding: 1rem;
}

.phone-modal .field {
    margin-bottom: 1rem;
}

.phone-modal .field.required .label::after {
    content: ' *';
    color: #e02b27;
}

.phone-modal .control input[type="tel"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.phone-modal .note {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.phone-modal .actions-toolbar {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
}

.phone-modal .actions-toolbar .primary,
.phone-modal .actions-toolbar .secondary {
    flex: 1;
}

.phone-modal .phone-error {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Update Phone Link */
.update-phone-wrapper {
    margin-top: 8px;
}

.update-phone-link {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.update-phone-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.calendar-links {
    margin-top: 8px;
}

.calendar-links a {
    color: #007bff;
    text-decoration: underline;
    margin-right: 12px;
}

.calendar-links a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* QR modal */
body.qr-modal-open {
    overflow: hidden;
}

.qr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.qr-modal-overlay.is-open {
    display: flex;
}

.qr-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 24px 24px 20px;
    max-width: min(90vw, 480px);
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.qr-modal-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 4px 8px;
}

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

.qr-modal-title {
    margin: 0 0 4px;
    font-size: 1.2em;
}

.qr-modal-date {
    margin: 0 0 16px;
    color: #555;
    font-size: 0.95em;
}

.qr-modal-image {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 360px;
    height: auto;
    background: #fff;
}

.qr-modal-hint {
    margin: 12px 0 0;
    color: #555;
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .qr-modal-image {
        max-width: 80vmin;
    }
}
