﻿/* Events Calendar Display Pro Styles */
.events-display-pro {
    font-family: inherit;
    line-height: 1.6;
    color: var(--text-color, #374151);
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --background-color: #ffffff;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --category-badge-color: #6366f1;
}

/* Loading States */
.events-loading,
.events-error,
.events-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #f9fafb;
    border-radius: 12px;
    margin: 2rem 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.empty-icon,
.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #9ca3af;
    display: block;
}

/* Ensure Dashicons are properly sized */
.dashicons {
    width: auto;
    height: auto;
    font-size: inherit;
    line-height: inherit;
    vertical-align: middle;
}

/* Filters */
.events-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.filter-search {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: var(--background-color);
    color: var(--text-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.filter-category,
.filter-date,
.filter-venue,
.filter-cost,
.filter-sort {
    min-width: 200px;
}

.category-filter,
.date-filter,
.venue-filter,
.cost-filter,
.sort-filter {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.category-filter:focus,
.date-filter:focus,
.venue-filter:focus,
.cost-filter:focus,
.sort-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Events Container */
.events-container {
    margin-bottom: 2rem;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
    gap: 2rem;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Event Cards Base */
.event-card {
    background: var(--background-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

/* Modern Template */
.template-modern .modern-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.template-modern .event-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.template-modern .event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.template-modern .event-card:hover .event-image img {
    transform: scale(1.05);
}

.template-modern .event-content {
    padding: 1.5rem;
}

.template-modern .event-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.template-modern .event-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.template-modern .event-title a:hover {
    color: var(--primary-color);
}

.template-modern .event-excerpt {
    color: #6b7280;
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-modern .event-meta {
    margin-bottom: 1rem;
}

.template-modern .event-meta > div {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.template-modern .event-meta .dashicons {
    margin-right: 0.5rem;
    font-size: 16px;
}

.template-modern .event-categories-meta {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.template-modern .event-categories-meta .dashicons {
    margin-right: 0.5rem;
    font-size: 16px;
}

.template-modern .event-read-more {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.template-modern .event-read-more:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Event Badges */
.category-badge,
.cost-badge,
.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: var(--category-badge-padding, 0.55rem 0.95rem);
    border-radius: var(--category-badge-border-radius, 20px);
    font-size: var(--category-badge-font-size, 0.75rem);
    font-weight: 600;
    color: var(--category-badge-text-color, white);
    z-index: 2;
    line-height: 1;
    white-space: nowrap;
}

.category-badge {
    background-color: var(--category-badge-color, #6366f1);
}

/* Stacked badges */
.category-badge + .category-badge {
    margin-top: 5px;
}

.cost-badge {
    top: 12px;
    right: 12px;
    background-color: #10b981;
}

.featured-badge {
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.featured-badge .dashicons {
    font-size: 12px;
}

/* Classic Template */
.template-classic .classic-card {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.template-classic .event-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.template-classic .event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-classic .event-content {
    padding: 1.5rem;
    position: relative;
}

.template-classic .event-date-classic {
    position: absolute;
    top: -20px;
    right: 20px;
}

.template-classic .date-box {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.template-classic .date-box .day {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.template-classic .date-box .month {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-classic .event-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1rem 0 0.75rem 0;
    line-height: 1.3;
}

.template-classic .event-title a {
    color: var(--text-color);
    text-decoration: none;
}

.template-classic .event-venue,
.template-classic .event-categories-meta {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.template-classic .event-venue .dashicons,
.template-classic .event-categories-meta .dashicons {
    margin-right: 0.5rem;
    font-size: 16px;
}

.template-classic .event-excerpt {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.template-classic .event-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.template-classic .event-button:hover {
    background: var(--secondary-color);
}

/* Minimal Template */
.template-minimal .minimal-card {
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.template-minimal .event-content {
    padding: 1rem 1.5rem;
}

.template-minimal .event-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.template-minimal .event-title a {
    color: var(--text-color);
    text-decoration: none;
}

.template-minimal .event-title a:hover {
    color: var(--primary-color);
}

.template-minimal .event-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.template-minimal .event-meta span {
    display: flex;
    align-items: center;
}

.template-minimal .event-meta .dashicons {
    margin-right: 0.25rem;
    font-size: 14px;
}

/* Magazine Template */
.template-magazine .magazine-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.template-magazine .event-image-large {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.template-magazine .event-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-magazine .image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem;
}

.template-magazine .image-overlay .event-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.template-magazine .image-overlay .event-title a {
    color: white;
    text-decoration: none;
}

.template-magazine .image-overlay .event-date {
    font-size: 0.875rem;
    opacity: 0.9;
}

.template-magazine .event-content {
    padding: 1.5rem;
}

.template-magazine .event-excerpt {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.template-magazine .event-categories-meta {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.template-magazine .event-categories-meta .dashicons {
    margin-right: 0.5rem;
    font-size: 16px;
}

.template-magazine .read-more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.template-magazine .read-more-link:hover {
    color: var(--secondary-color);
}

/* Timeline Template */
.template-timeline .events-container {
    position: relative;
}

.template-timeline .events-container::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.template-timeline .timeline-card {
    position: relative;
    margin-left: 4rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.template-timeline .timeline-marker {
    position: absolute;
    left: -3rem;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--border-color);
}

.template-timeline .timeline-content {
    padding: 1.5rem;
}

.template-timeline .event-date-timeline {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.template-timeline .event-main {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.template-timeline .event-image-small {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.template-timeline .event-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-timeline .event-text {
    flex: 1;
}

.template-timeline .event-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.template-timeline .event-title a {
    color: var(--text-color);
    text-decoration: none;
}

.template-timeline .event-title a:hover {
    color: var(--primary-color);
}

.template-timeline .event-venue,
.template-timeline .event-categories-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.template-timeline .event-venue .dashicons,
.template-timeline .event-categories-meta .dashicons {
    margin-right: 0.5rem;
    font-size: 16px;
}

.template-timeline .event-excerpt {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .events-grid.columns-4,
    .events-grid.columns-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .events-filters {
        flex-direction: column;
        padding: 1rem;
    }
    
    .filter-search,
    .filter-category,
    .filter-date,
    .filter-venue,
    .filter-cost,
    .filter-sort {
        min-width: auto;
    }
    
    .template-modern .event-content,
    .template-classic .event-content,
    .template-magazine .event-content {
        padding: 1rem;
    }
    
    .template-timeline .timeline-card {
        margin-left: 2rem;
    }
    
    .template-timeline .timeline-marker {
        left: -1.5rem;
    }
    
    .template-timeline .events-container::before {
        left: 1rem;
    }
    
    .template-timeline .event-main {
        flex-direction: column;
    }
    
    .template-timeline .event-image-small {
        width: 100%;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .events-loading,
    .events-error,
    .events-empty {
        padding: 2rem 1rem;
    }
    
    .template-modern .event-image,
    .template-classic .event-image {
        height: 160px;
    }
    
    .template-magazine .event-image-large {
        height: 200px;
    }
    
    .template-magazine .image-overlay {
        padding: 1rem;
    }
    
    .template-magazine .image-overlay .event-title {
        font-size: 1.25rem;
    }
}

/* Animation for smooth loading */
.event-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.event-read-more:focus,
.event-button:focus,
.read-more-link:focus,
.search-input:focus,
.category-filter:focus,
.date-filter:focus,
.venue-filter:focus,
.cost-filter:focus,
.sort-filter:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .events-filters {
        display: none;
    }
    
    .event-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    .event-read-more,
    .event-button,
    .read-more-link {
        display: none;
    }
}