/**
 * CET Events Page - Premium UI
 * Beautiful event listing with filters
 */

/* ============================================
   ROOT VARIABLES
   ============================================ */
.cet-events-page {
    --cet-primary: #6366f1;
    --cet-primary-dark: #4f46e5;
    --cet-primary-light: #818cf8;
    --cet-secondary: #ec4899;
    --cet-accent: #06b6d4;
    --cet-success: #10b981;
    --cet-warning: #f59e0b;
    
    --cet-bg: #f8fafc;
    --cet-surface: #ffffff;
    --cet-surface-hover: #f1f5f9;
    --cet-border: #e2e8f0;
    
    --cet-text: #1e293b;
    --cet-text-secondary: #64748b;
    --cet-text-muted: #94a3b8;
    --cet-text-inverse: #ffffff;
    
    --cet-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --cet-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --cet-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --cet-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    --cet-radius-sm: 8px;
    --cet-radius: 12px;
    --cet-radius-lg: 16px;
    --cet-radius-xl: 24px;
    --cet-radius-full: 9999px;
    
    --cet-transition: all 0.2s ease;
    --cet-transition-slow: all 0.3s ease;
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    padding: 0;
    margin: 0 auto;
    max-width: 1400px;
}

/* ============================================
   HEADER
   ============================================ */
.cet-events-header {
    margin-bottom: 32px;
}

.cet-events-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--cet-text);
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cet-title-icon {
    font-size: 36px;
}

/* ============================================
   CONTROLS
   ============================================ */
.cet-events-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Search Box */
.cet-search-box {
    position: relative;
    max-width: 400px;
}

.cet-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

.cet-search-input {
    width: 100%;
    padding: 14px 48px 14px 40px;
    font-size: 15px;
    border: 2px solid var(--cet-border);
    border-radius: var(--cet-radius-full);
    background: var(--cet-surface);
    color: var(--cet-text);
    transition: var(--cet-transition);
    font-family: inherit;
}

.cet-search-input:focus {
    outline: none;
    border-color: var(--cet-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.cet-search-input::placeholder {
    color: var(--cet-text-muted);
}

.cet-search-clear {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--cet-border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--cet-text-secondary);
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--cet-transition);
}

.cet-search-clear:hover {
    background: var(--cet-text-muted);
    color: white;
}

.cet-search-box.has-value .cet-search-clear {
    display: flex;
}

/* Filter Chips */
.cet-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cet-filter-chip {
    padding: 10px 20px;
    border: 2px solid var(--cet-border);
    border-radius: var(--cet-radius-full);
    background: var(--cet-surface);
    color: var(--cet-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--cet-transition);
    font-family: inherit;
}

.cet-filter-chip:hover {
    border-color: var(--cet-primary-light);
    color: var(--cet-primary);
    background: rgba(99, 102, 241, 0.05);
}

.cet-filter-chip.active {
    background: linear-gradient(135deg, var(--cet-primary) 0%, var(--cet-secondary) 100%);
    border-color: transparent;
    color: white;
}

/* Filter Dropdowns */
.cet-filter-dropdowns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cet-filter-select {
    padding: 12px 40px 12px 16px;
    font-size: 14px;
    border: 2px solid var(--cet-border);
    border-radius: var(--cet-radius);
    background: var(--cet-surface);
    color: var(--cet-text);
    cursor: pointer;
    transition: var(--cet-transition);
    font-family: inherit;
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    min-width: 160px;
}

.cet-filter-select:focus {
    outline: none;
    border-color: var(--cet-primary);
}

/* ============================================
   EVENTS GRID
   ============================================ */
.cet-events-grid {
    display: grid;
    gap: 24px;
}

.cet-columns-2 .cet-events-grid {
    grid-template-columns: repeat(2, 1fr);
}

.cet-columns-3 .cet-events-grid {
    grid-template-columns: repeat(3, 1fr);
}

.cet-columns-4 .cet-events-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   EVENT CARD
   ============================================ */
.cet-event-card {
    background: var(--cet-surface);
    border-radius: var(--cet-radius-lg);
    overflow: hidden;
    box-shadow: var(--cet-shadow);
    transition: var(--cet-transition-slow);
    display: flex;
    flex-direction: column;
}

.cet-event-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--cet-shadow-xl);
}

.cet-event-card.hidden {
    display: none;
}

/* Image */
.cet-event-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.cet-event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--cet-transition-slow);
}

.cet-event-card:hover .cet-event-image {
    transform: scale(1.05);
}

.cet-event-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cet-primary) 0%, var(--cet-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cet-event-placeholder span {
    font-size: 64px;
}

/* Tags */
.cet-event-tags {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cet-event-tag {
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--cet-radius-full);
    text-transform: uppercase;
}

/* Badge */
.cet-event-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--cet-primary) 0%, var(--cet-secondary) 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--cet-radius-full);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cet-event-badge span {
    font-weight: 700;
}

/* Content */
.cet-event-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.cet-event-content .cet-event-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--cet-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cet-event-date,
.cet-event-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--cet-text-secondary);
}

.cet-date-icon,
.cet-location-icon {
    font-size: 14px;
}

/* Footer */
.cet-event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--cet-border);
    gap: 12px;
    flex-wrap: wrap;
}

.cet-event-price {
    display: flex;
    flex-direction: column;
}

.cet-price-label {
    font-size: 11px;
    color: var(--cet-text-muted);
}

.cet-price-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--cet-primary);
}

.cet-event-buttons {
    display: flex;
    gap: 8px;
}

.cet-event-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--cet-radius);
    text-decoration: none;
    transition: var(--cet-transition);
    white-space: nowrap;
}

.cet-event-btn.cet-btn-primary {
    background: linear-gradient(135deg, var(--cet-primary) 0%, var(--cet-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.cet-event-btn.cet-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

.cet-event-btn.cet-btn-secondary {
    background: var(--cet-surface);
    color: var(--cet-text);
    border: 2px solid var(--cet-border);
}

.cet-event-btn.cet-btn-secondary:hover {
    border-color: var(--cet-primary);
    color: var(--cet-primary);
    background: rgba(99, 102, 241, 0.05);
}

.cet-btn-arrow {
    transition: var(--cet-transition);
}

.cet-event-btn:hover .cet-btn-arrow {
    transform: translateX(-4px);
}

/* ============================================
   NO EVENTS MESSAGE
   ============================================ */
.cet-no-events-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--cet-surface);
    border-radius: var(--cet-radius-lg);
    box-shadow: var(--cet-shadow);
}

.cet-no-events-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cet-no-events-message h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--cet-text);
    margin: 0 0 8px 0;
}

.cet-no-events-message p {
    font-size: 14px;
    color: var(--cet-text-secondary);
    margin: 0;
}

/* ============================================
   LIST LAYOUT
   ============================================ */
.cet-layout-list .cet-events-grid {
    grid-template-columns: 1fr !important;
}

.cet-layout-list .cet-event-card {
    flex-direction: row;
}

.cet-layout-list .cet-event-image-wrapper {
    width: 280px;
    height: auto;
    min-height: 180px;
    flex-shrink: 0;
}

.cet-layout-list .cet-event-content {
    padding: 24px;
}

.cet-layout-list .cet-event-footer {
    border-top: none;
    padding-top: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes cet-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cet-event-card {
    animation: cet-fade-in 0.4s ease-out backwards;
}

.cet-event-card:nth-child(1) { animation-delay: 0.05s; }
.cet-event-card:nth-child(2) { animation-delay: 0.1s; }
.cet-event-card:nth-child(3) { animation-delay: 0.15s; }
.cet-event-card:nth-child(4) { animation-delay: 0.2s; }
.cet-event-card:nth-child(5) { animation-delay: 0.25s; }
.cet-event-card:nth-child(6) { animation-delay: 0.3s; }
.cet-event-card:nth-child(7) { animation-delay: 0.35s; }
.cet-event-card:nth-child(8) { animation-delay: 0.4s; }
.cet-event-card:nth-child(9) { animation-delay: 0.45s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .cet-columns-4 .cet-events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .cet-columns-3 .cet-events-grid,
    .cet-columns-4 .cet-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cet-layout-list .cet-event-card {
        flex-direction: column;
    }
    
    .cet-layout-list .cet-event-image-wrapper {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .cet-events-title {
        font-size: 24px;
    }
    
    .cet-columns-2 .cet-events-grid,
    .cet-columns-3 .cet-events-grid,
    .cet-columns-4 .cet-events-grid {
        grid-template-columns: 1fr;
    }
    
    .cet-filter-dropdowns {
        width: 100%;
    }
    
    .cet-filter-select {
        flex: 1;
    }
    
    .cet-event-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .cet-event-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .cet-events-page {
        padding: 0 16px;
    }
    
    .cet-events-header {
        margin-bottom: 20px;
    }
    
    .cet-search-box {
        max-width: 100%;
    }
    
    .cet-event-content {
        padding: 16px;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.cet-event-card.loading {
    pointer-events: none;
}

.cet-event-card.loading .cet-event-image-wrapper,
.cet-event-card.loading .cet-event-title,
.cet-event-card.loading .cet-event-date,
.cet-event-card.loading .cet-event-location {
    background: linear-gradient(90deg, var(--cet-border) 25%, var(--cet-surface-hover) 50%, var(--cet-border) 75%);
    background-size: 200% 100%;
    animation: cet-shimmer 1.5s infinite;
    border-radius: var(--cet-radius-sm);
}

@keyframes cet-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   EVENT DETAILS MODAL
   ============================================ */
.cet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

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

.cet-modal {
    background: var(--cet-surface);
    border-radius: var(--cet-radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: var(--cet-shadow-xl);
    animation: cet-modal-appear 0.3s ease-out;
}

@keyframes cet-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cet-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--cet-text);
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: var(--cet-transition);
    box-shadow: var(--cet-shadow);
}

.cet-modal-close:hover {
    background: white;
    transform: scale(1.1);
}

.cet-modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

.cet-modal-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, var(--cet-primary) 0%, var(--cet-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.cet-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cet-modal-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    opacity: 0.5;
}

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

.cet-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--cet-text);
    margin: 0 0 12px 0;
}

.cet-modal-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cet-modal-location {
    font-size: 14px;
    color: var(--cet-text-secondary);
}

.cet-modal-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--cet-text);
    margin-bottom: 20px;
}

.cet-modal-description p {
    margin: 0 0 12px 0;
}

.cet-modal-performances {
    background: var(--cet-bg);
    border-radius: var(--cet-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.cet-modal-performances h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--cet-text);
    margin: 0 0 12px 0;
}

.cet-modal-performances ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cet-modal-performances li {
    background: var(--cet-surface);
    padding: 8px 14px;
    border-radius: var(--cet-radius-sm);
    font-size: 13px;
    color: var(--cet-text);
    border: 1px solid var(--cet-border);
}

.cet-modal-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--cet-border);
}

.cet-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--cet-radius);
    text-decoration: none;
    transition: var(--cet-transition);
}

.cet-modal-btn.cet-btn-primary {
    background: linear-gradient(135deg, var(--cet-primary) 0%, var(--cet-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.cet-modal-btn.cet-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    color: white;
}

/* Mobile Modal */
@media (max-width: 576px) {
    .cet-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .cet-modal {
        max-height: 95vh;
        border-radius: var(--cet-radius-lg) var(--cet-radius-lg) 0 0;
        animation: cet-modal-slide-up 0.3s ease-out;
    }
    
    @keyframes cet-modal-slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .cet-modal-image {
        height: 180px;
    }
    
    .cet-modal-body {
        padding: 20px;
    }
    
    .cet-modal-title {
        font-size: 20px;
    }
    
    .cet-modal-actions {
        justify-content: center;
    }
    
    .cet-modal-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Button as button element */
button.cet-event-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
}
