/**
 * Church CMS - Modern Site Styles
 * @package     com_churchcms
 * @version     1.0.0
 */

/* CSS Variables */
:root {
    --primary-color: #96164a;
    --secondary-color: #f5e51b;
    --accent-color: #8B4513;
    --text-color: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --background-light: #f8f8f8;
    --background-white: #ffffff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

/* General Styles */
.com-churchcms-events {
    margin: 0 auto;
    padding: 0;
}

/* Modern Page Header */
.events-page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7a1139 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.events-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='3'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.3;
}

.events-page-header .container {
    position: relative;
    z-index: 2;
}

.events-page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.events-page-header .subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Filter Section */
.events-filters {
    background: var(--background-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.events-filters h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--background-white);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(150, 22, 74, 0.1);
}

.filter-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
}

.filter-btn:hover {
    background: #7a1139;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Events Grid */
.events-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

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

/* Event Card */
.event-card {
    background: var(--background-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
}

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

.event-card.featured {
    border: 2px solid var(--secondary-color);
}

.event-card.featured::before {
    content: '★';
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: var(--primary-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
}

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

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

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

.event-date-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(150, 22, 74, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

.event-type-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

/* Event Content */
.event-content {
    padding: 25px;
}

.event-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.3;
}

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

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

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-meta-item i {
    color: var(--primary-color);
    width: 16px;
}

.event-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.event-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.event-status.upcoming {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.event-status.ongoing {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.event-status.past {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.event-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.event-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.event-btn-primary {
    background: var(--primary-color);
    color: white;
}

.event-btn-primary:hover {
    background: #7a1139;
    color: white;
    text-decoration: none;
}

.event-btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.event-btn-outline:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* No Events State */
.no-events {
    text-align: center;
    padding: 60px 20px;
    background: var(--background-light);
    border-radius: var(--border-radius-lg);
    border: 2px dashed var(--border-color);
}

.no-events i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.no-events h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.no-events p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Pagination */
.events-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

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

@media (max-width: 992px) {
    .events-grid.grid-3,
    .events-grid.grid-4 { grid-template-columns: repeat(2, 1fr); }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: unset;
    }
    
    .events-page-header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .events-grid.grid-2,
    .events-grid.grid-3,
    .events-grid.grid-4 { grid-template-columns: 1fr; }
    
    .events-page-header {
        padding: 40px 0;
    }
    
    .events-page-header h1 {
        font-size: 2rem;
    }
    
    .events-filters {
        padding: 20px;
    }
    
    .event-image-wrapper {
        height: 180px;
    }
    
    .event-content {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .events-page-header h1 {
        font-size: 1.75rem;
    }
    
    .event-actions {
        flex-direction: column;
    }
    
    .event-btn {
        flex: none;
    }
    
    .events-filters {
        margin: 0 -15px 30px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* Loading States */
.events-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-light);
}

.events-loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Accessibility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Print Styles */
@media print {
    .events-filters,
    .events-pagination,
    .event-actions {
        display: none !important;
    }
    
    .event-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    .events-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}