/**
 * IMCA Events Manager CSS - Modern Design
 * Complete redesign with modern aesthetics and responsive grid
 */

/* Container */
.imca-events-container {
    margin: 32px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Modern Filter Design */
.imca-modern-filters {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.imca-modern-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.imca-filter-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.imca-filter-title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.imca-filter-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.imca-filter-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    position: relative;
    z-index: 1;
}

.imca-modern-filter-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    padding: 18px 24px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.imca-modern-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.imca-modern-filter-btn:hover::before {
    left: 100%;
}

.imca-modern-filter-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.imca-modern-filter-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 8px 32px rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.imca-modern-filter-btn.active:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 40px rgba(255,255,255,0.4);
}


/* Modern Cards Grid */
.imca-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.imca-event-card {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
}

.imca-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.imca-event-card:hover::before {
    transform: scaleX(1);
}

.imca-event-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border-color: rgba(102, 126, 234, 0.1);
}

.imca-event-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 24px 0;
    color: #1a202c;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.imca-event-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.imca-event-detail {
    display: flex;
    align-items: flex-start;
    font-size: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    position: relative;
}

.imca-event-detail:last-child {
    border-bottom: none;
}

.imca-detail-icon {
    display: none;
}

.imca-detail-label {
    font-weight: 700;
    min-width: 80px;
    color: #667eea;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 16px;
}

.imca-detail-value {
    flex: 1;
    color: #2d3748;
    font-weight: 500;
    line-height: 1.6;
}

/* Modern Summary */
.imca-modern-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #4a5568;
    text-align: center;
    margin-bottom: 32px;
    font-size: 16px;
    font-weight: 600;
    padding: 20px 32px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

/* Enhanced Pagination */
.imca-pagination {
    margin: 48px 0 32px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imca-pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    background: white;
    padding: 16px 24px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.04);
}

.imca-pagination-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.imca-pagination-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.imca-pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.imca-pagination-btn.active:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.imca-pagination-prev,
.imca-pagination-next {
    padding: 12px 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.imca-pagination-prev:hover,
.imca-pagination-next:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.imca-pagination-dots {
    color: #a0aec0;
    font-weight: bold;
    padding: 0 12px;
    user-select: none;
}

/* Loading States */
.imca-events-loading,
.imca-filter-loading {
    text-align: center;
    padding: 64px 32px;
    color: #4a5568;
    font-weight: 600;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    margin: 32px 0;
    font-size: 18px;
    position: relative;
    overflow: hidden;
}

.imca-events-loading::before,
.imca-filter-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.imca-events-error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    padding: 32px;
    border: 2px solid #fc8181;
    border-radius: 24px;
    margin: 32px 0;
    font-size: 16px;
    line-height: 1.6;
    box-shadow: 0 8px 24px rgba(248, 113, 113, 0.2);
    font-weight: 500;
}

.imca-events-error button {
    transition: all 0.3s ease;
    background: #667eea;
    border-radius: 12px;
    font-weight: 600;
}

.imca-events-error button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.imca-no-events {
    text-align: center;
    color: #4a5568;
    font-weight: 600;
    padding: 64px 32px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 24px;
    margin: 32px 0;
    font-size: 18px;
    position: relative;
}

.imca-no-events::before {
    content: 'No Events';
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    opacity: 0.8;
    color: #667eea;
}

/* List Style (Enhanced) */
.imca-events-list-style {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.imca-event-item {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.04);
}

.imca-event-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.imca-event-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-bottom: 12px;
}

.imca-event-summary .imca-event-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    min-width: 200px;
    color: #1a202c;
}

.imca-event-date {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.imca-event-council {
    background: #f7fafc;
    color: #4a5568;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #e2e8f0;
}

.imca-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.imca-meta-item {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* Table Style (Enhanced) */
.imca-events-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 32px;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
}

.imca-events-table th,
.imca-events-table td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.imca-events-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    font-weight: 700;
    color: #1a202c;
    border-bottom: 2px solid #e2e8f0;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.imca-events-table tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f7fafc 100%);
}

.imca-events-table tr:last-child td {
    border-bottom: none;
}

/* Count and Next Event (Enhanced) */
.imca-events-count {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.imca-next-event {
    margin: 32px 0;
}

.imca-next-inline {
    display: inline-block;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    color: #667eea;
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 600;
    border: 2px solid #e6f3ff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .imca-events-container {
        margin: 20px 0;
    }
    
    .imca-modern-filters {
        padding: 24px 20px;
        border-radius: 16px;
        margin-bottom: 32px;
    }
    
    .imca-filter-title {
        font-size: 24px;
    }
    
    .imca-filter-subtitle {
        font-size: 14px;
    }
    
    .imca-filter-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .imca-modern-filter-btn {
        padding: 16px 20px;
        min-height: 56px;
        font-size: 14px;
    }
    
    
    .imca-events-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 24px;
    }
    
    .imca-event-card {
        padding: 24px 20px;
        border-radius: 20px;
    }
    
    .imca-event-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .imca-event-detail {
        font-size: 14px;
        padding: 10px 0;
    }
    
    .imca-detail-label {
        min-width: 70px;
        font-size: 12px;
        margin-right: 12px;
    }
    
    .imca-modern-summary {
        padding: 16px 20px;
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .imca-pagination-controls {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .imca-pagination-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 44px;
        height: 44px;
    }
    
    .imca-pagination-prev,
    .imca-pagination-next {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .imca-events-loading,
    .imca-filter-loading {
        padding: 48px 24px;
        font-size: 16px;
    }
    
    .imca-no-events {
        padding: 48px 24px;
        font-size: 16px;
    }
    
    .imca-no-events::before {
        font-size: 20px;
        margin-bottom: 12px;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .imca-modern-filters {
        padding: 20px 16px;
    }
    
    .imca-filter-title {
        font-size: 22px;
    }
    
    .imca-modern-filter-btn {
        padding: 14px 18px;
        min-height: 52px;
        font-size: 13px;
    }
    
    .imca-event-card {
        padding: 20px 16px;
    }
    
    .imca-event-title {
        font-size: 18px;
    }
    
    .imca-detail-label {
        min-width: 60px;
        font-size: 11px;
    }
    
    .imca-pagination-controls {
        gap: 6px;
        padding: 10px 12px;
    }
    
    .imca-pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
        height: 40px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .imca-event-card {
        background: #1a202c;
        color: #e2e8f0;
        border-color: #2d3748;
    }
    
    .imca-event-title {
        color: #f7fafc;
    }
    
    .imca-detail-value {
        color: #e2e8f0;
    }
    
    .imca-modern-summary {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .imca-events-table {
        background: #1a202c;
    }
    
    .imca-events-table th {
        background: #2d3748;
        color: #f7fafc;
    }
    
    .imca-events-table tr:hover {
        background: #2d3748;
    }
}

/* High contrast accessibility */
@media (prefers-contrast: high) {
    .imca-modern-filter-btn {
        border-width: 3px;
    }
    
    .imca-event-card {
        border-width: 2px;
    }
    
    .imca-pagination-btn {
        border-width: 3px;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .imca-event-card,
    .imca-modern-filter-btn,
    .imca-pagination-btn {
        transition: none;
    }
    
    .imca-event-card:hover,
    .imca-modern-filter-btn:hover,
    .imca-pagination-btn:hover {
        transform: none;
    }
    
    @keyframes loading-shimmer {
        0%, 100% { left: -100%; }
    }
}