/**
 * Event Directory Filter Styles
 *
 * Styling for event directory filter component.
 * Uses FAOM global color palette and design system.
 *
 * @package FAOM_Membership_Pro
 * @since 2.0.0
 */

/* ====================
   CSS VARIABLES (FAOM Global Palette)
   ==================== */

:root {
    /* Primary Colors */
    --faom-primary: #84d6ed;           /* Primary cyan */
    --faom-primary-hover: #6bc5df;     /* Hover state */
    --faom-primary-active: #5ab8d4;    /* Active state */

    /* Secondary Colors */
    --faom-secondary: #59848e;         /* Secondary teal */
    --faom-secondary-hover: #4a717a;   /* Hover state */

    /* Background Colors */
    --faom-bg-white: #ffffff;          /* Pure white */
    --faom-bg-light: #f9f9f9;          /* Off white */
    --faom-bg-gray: #f0f0f1;           /* Light gray */

    /* Text Colors */
    --faom-text-dark: #000203;         /* Dark text */
    --faom-text-medium: #646970;       /* Medium gray */
    --faom-text-light: #c3c4c7;        /* Light gray */

    /* Border Colors */
    --faom-border: #05181c;               /* Default border */
    --faom-border-light: #05181c;      /* Light border */

    /* Status Colors */
    --faom-success: #10b981;           /* Success green */
    --faom-error: #ef4444;             /* Error red */
    --faom-warning: #f59e0b;           /* Warning amber */

    /* Dark Mode Colors */
    --faom-dark-bg: #000203;           /* Dark background */
    --faom-dark-card: #00070a;         /* Dark card */
    --faom-dark-border: #05181c;       /* Dark border */

    /* Shadows */
    --faom-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --faom-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --faom-shadow-lg: 0 4px 12px rgba(11, 175, 219, 0.3);

    /* Border Radius */
    --faom-radius-sm: 4px;
    --faom-radius-md: 8px;
    --faom-radius-lg: 12px;
    --faom-radius-pill: 100px;

    /* Spacing */
    --faom-space-xs: 8px;
    --faom-space-sm: 12px;
    --faom-space-md: 16px;
    --faom-space-lg: 20px;
    --faom-space-xl: 30px;
    --faom-space-2xl: 40px;
}

/* ====================
   FILTER CONTAINER
   ==================== */

.faom-event-directory-filter {
    /* No background or padding - controlled by Oxygen Builder */
    margin-bottom: var(--faom-space-2xl);
}

/* ====================
   FILTER FORM
   ==================== */

.faom-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--faom-space-md);
    align-items: end;
}

.faom-filter-form > * {
    flex: 1 1 auto;
    min-width: 180px;
}

/* ====================
   FILTER FIELDS
   ==================== */

.faom-filter-field {
    display: flex;
    flex-direction: column;
    gap: var(--faom-space-xs);
}

.faom-filter-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--faom-text-dark);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ====================
   FORM INPUTS
   ==================== */

.faom-filter-input,
.faom-filter-select {
    width: 100%;
    padding: var(--faom-space-sm) var(--faom-space-md);
    font-size: 14px;
    line-height: 1.5;
    color: var(--faom-text-dark);
    background: var(--faom-bg-gray);
    border: 1px solid #04181b;
    border-radius: var(--faom-radius-md);
    transition: all 0.2s ease;
}

.faom-filter-input:focus,
.faom-filter-select:focus {
    outline: none;
    background: var(--faom-bg-white);
    border-color: var(--faom-primary);
    box-shadow: 0 0 0 3px rgba(11, 175, 219, 0.1);
}

.faom-filter-input::placeholder {
    color: var(--faom-text-medium);
}

.faom-filter-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23646970' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

.faom-filter-select optgroup {
    font-weight: 600;
    font-size: 14px;
    color: var(--faom-text-dark);
}

.faom-filter-select option {
    font-weight: 400;
    padding: var(--faom-space-xs) var(--faom-space-sm);
}

/* ====================
   FILTER BUTTONS
   ==================== */

.faom-filter-actions {
    display: flex;
    gap: var(--faom-space-sm);
    align-items: center;
}

.faom-filter-button {
    padding: var(--faom-space-sm) 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--faom-radius-pill);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.faom-filter-submit {
    background: var(--faom-primary);
    color: #000000;
}

.faom-filter-submit:hover {
    background: var(--faom-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--faom-shadow-lg);
}

.faom-filter-submit:active {
    background: var(--faom-primary-active);
    transform: translateY(0);
}

.faom-filter-submit:disabled {
    background: var(--faom-border-light);
    color: var(--faom-text-medium);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.faom-filter-reset {
    background-color: var(--faom-bg-white);
    border: 1px solid var(--faom-secondary);
    color: var(--faom-secondary);
}

.faom-filter-reset:hover {
    filter: invert(10%);
    background-color: #05181c;
}

/* ====================
   LOADING INDICATOR
   ==================== */

.faom-filter-loading {
    display: flex;
    align-items: center;
    gap: var(--faom-space-sm);
    padding: var(--faom-space-sm) 0;
    color: var(--faom-text-medium);
    font-size: 14px;
}

.faom-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--faom-border-light);
    border-top-color: var(--faom-primary);
    border-radius: 50%;
    animation: faom-spin 0.6s linear infinite;
}

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

/* ====================
   RESULTS COUNT
   ==================== */

/* ====================
   EVENT CARDS
   ==================== */

.event-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    transition: opacity 0.3s ease;
}

/* Equal height cards - Oxygen layout structure */
[data-id="div_block-1442-1296"] {
    display: flex;
    flex-direction: column;
    height: 100%;
}

[data-id="div_block-1443-1296"] {
    display: flex;
    flex-direction: column;
    height: 100%;
}

[data-id="div_block-1444-1296"] {
    display: flex;
    flex-direction: column;
    flex: 1;
}

[data-id="div_block-1446-1296"] {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.event-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.event-poster {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}

.event-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-poster a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Event Type Badge */
.event-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-type-badge.event-type-physical {
    background: rgba(16, 185, 129, 0.95);
    color: white;
}

.event-type-badge.event-type-virtual {
    background: rgba(59, 130, 246, 0.95);
    color: white;
}

.event-type-badge.event-type-hybrid {
    background: rgba(139, 92, 246, 0.95);
    color: white;
}

/* Event Details Section */
.event-details {
    padding: 20px;
}

.event-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.event-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.15s ease;
}

.event-title a:hover {
    color: #84d6ed;
}

.event-organizer {
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.organizer-label {
    font-weight: 500;
}

.organizer-name {
    color: #374151;
}

/* Event Meta Info */
.event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.event-meta-item .icon {
    flex-shrink: 0;
    color: #84d6ed;
}

.event-date-wrapper {
    font-weight: 500;
}

.event-time {
    margin-left: 4px;
    color: #6b7280;
}

.event-location-wrapper {
    color: #6b7280;
}

/* Event Status Badge */
.event-status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: capitalize;
}

.event-status-badge.status-upcoming {
    background: #dbeafe;
    color: #1e40af;
}

.event-status-badge.status-ongoing {
    background: #d1fae5;
    color: #065f46;
}

.event-status-badge.status-completed {
    background: #e5e7eb;
    color: #374151;
}

.event-status-badge.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Event Excerpt */
.event-excerpt {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

/* Event Actions */
.event-actions {
    margin-top: 16px;
}

.event-register-btn,
.event-view-btn {
    display: inline-block;
    width: 100%;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.event-register-btn {
    background: #84d6ed;
    color: #000;
}

.event-register-btn:hover {
    background: #6bc4e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(132, 214, 237, 0.4);
}

.event-view-btn {
    background: #f3f4f6;
    color: #374151;
}

.event-view-btn:hover {
    background: #e5e7eb;
}

/* ====================
   NO RESULTS MESSAGE
   ==================== */

.faom-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--faom-text-medium);
}

.faom-no-results p {
    font-size: 16px;
    margin: 0;
}

/* ====================
   PROGRESS BAR
   ==================== */

.faom-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 99999;
    overflow: hidden;
}

.faom-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--faom-primary), var(--faom-primary-hover), var(--faom-primary));
    width: 0;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--faom-primary);
}

/* ====================
   SKELETON LOADING ANIMATION
   ==================== */

/* Skeleton loading - overlay on existing cards */
.faom-skeleton-loading {
    pointer-events: none;
    opacity: 0.6;
}

.faom-skeleton-avatar,
.faom-skeleton-line,
.faom-skeleton-button {
    position: relative;
    overflow: hidden;
}

/* Hide all text content and images */
.faom-skeleton-avatar *,
.faom-skeleton-line *,
.faom-skeleton-button * {
    visibility: hidden !important;
}

/* Hide image element specifically */
.faom-skeleton-avatar {
    opacity: 0 !important;
}

/* Base background for skeleton elements - Gradient shimmer base */
.faom-skeleton-avatar::before,
.faom-skeleton-line::before,
.faom-skeleton-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    border-radius: 4px;
    z-index: 1;
}

/* Beautiful shimmer overlay - Trendy color options */
.faom-skeleton-avatar::after,
.faom-skeleton-line::after,
.faom-skeleton-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;

    /* === OPTION 1 - FAOM Cyan Shimmer (Brand-aligned) === */
    /* background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(132, 214, 237, 0.15) 20%,
        rgba(132, 214, 237, 0.35) 50%,
        rgba(132, 214, 237, 0.15) 80%,
        transparent 100%
    ); */

    /* === CURRENT: OPTION 2 - Holographic Rainbow (Trendy & Eye-catching) === */
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 182, 193, 0.2) 15%,
        rgba(186, 230, 253, 0.3) 30%,
        rgba(196, 181, 253, 0.4) 50%,
        rgba(186, 230, 253, 0.3) 70%,
        rgba(255, 182, 193, 0.2) 85%,
        transparent 100%
    );

    /* === OPTION 3 - Gold Luxe === */
    /* background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(251, 191, 36, 0.1) 20%,
        rgba(252, 211, 77, 0.25) 40%,
        rgba(253, 224, 71, 0.35) 50%,
        rgba(252, 211, 77, 0.25) 60%,
        rgba(251, 191, 36, 0.1) 80%,
        transparent 100%
    ); */

    /* === OPTION 4 - Aqua Fresh === */
    /* background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(16, 185, 129, 0.1) 20%,
        rgba(52, 211, 153, 0.2) 40%,
        rgba(110, 231, 183, 0.3) 50%,
        rgba(52, 211, 153, 0.2) 60%,
        rgba(16, 185, 129, 0.1) 80%,
        transparent 100%
    ); */

    /* === OPTION 5 - Purple Dream === */
    /* background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(168, 85, 247, 0.12) 20%,
        rgba(192, 132, 252, 0.25) 40%,
        rgba(216, 180, 254, 0.35) 50%,
        rgba(192, 132, 252, 0.25) 60%,
        rgba(168, 85, 247, 0.12) 80%,
        transparent 100%
    ); */

    /* === OPTION 6 - Rose Gold === */
    /* background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(251, 113, 133, 0.12) 20%,
        rgba(252, 165, 165, 0.22) 40%,
        rgba(254, 202, 202, 0.3) 50%,
        rgba(252, 165, 165, 0.22) 60%,
        rgba(251, 113, 133, 0.12) 80%,
        transparent 100%
    ); */

    animation: faom-skeleton-shimmer 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes faom-skeleton-shimmer {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}

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

@media (max-width: 768px) {
    .faom-event-directory-filter {
        padding: var(--faom-space-lg);
        margin-bottom: var(--faom-space-xl);
    }

    .faom-filter-form {
        flex-direction: column;
        gap: var(--faom-space-md);
    }

    .faom-filter-form > * {
        width: 100%;
        min-width: unset;
    }

    .faom-filter-actions {
        flex-direction: column;
        width: 100%;
    }

    .faom-filter-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .faom-event-directory-filter {
        padding: var(--faom-space-md);
        border-radius: var(--faom-radius-md);
    }

    .faom-filter-input,
    .faom-filter-select {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
}

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

/* Focus visible for keyboard navigation */
.faom-filter-button:focus-visible {
    outline: 2px solid var(--faom-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .faom-filter-input,
    .faom-filter-select {
        border: 2px solid currentColor;
    }

    .faom-filter-button {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .faom-filter-button,
    .faom-filter-input,
    .faom-filter-select {
        transition: none;
    }

    .faom-spinner {
        animation: none;
    }
}

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

@media (prefers-color-scheme: dark) {
    .faom-event-directory-filter {
        /* No default background - add in Oxygen Builder */
        color: var(--faom-bg-white);
    }

    .faom-filter-field label {
        color: var(--faom-bg-white);
    }

    .faom-filter-input,
    .faom-filter-select {
        background: var(--faom-dark-bg);
        border-color: var(--faom-dark-border);
        color: var(--faom-bg-white);
    }

    .faom-filter-input::placeholder {
        color: #9ca3af;
    }

    .faom-filter-input:focus,
    .faom-filter-select:focus {
        background: var(--faom-dark-bg);
        border-color: var(--faom-primary);
    }

    .faom-filter-reset {
        background-color: var(--faom-dark-card);
        border-color: var(--faom-secondary);
        color: var(--faom-secondary);
    }

    .faom-filter-reset:hover {
        filter: invert(10%);
        background-color: #05181c;
    }

    .faom-filter-loading {
        color: #9ca3af;
    }

    .faom-no-results {
        color: #9ca3af;
    }

    .faom-spinner {
        border-color: var(--faom-dark-border);
        border-top-color: var(--faom-primary);
    }
}
