/**
 * Recurring Events Styles
 * 
 * Styles for recurring event features across the theme
 * 
 * @package CSI_Diocese_Theme
 * @since 1.0.9
 */

/* ===============================================
   Event Cards - Recurring Indicators
   =============================================== */

.event-card.recurring-event {
    position: relative;
}

.recurring-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.95) 0%, rgba(215, 51, 51, 0.95) 100%);
    color: white;
    padding: 6px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(30, 91, 168, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
}

.recurring-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(30, 91, 168, 0.5);
}

.recurring-badge svg {
    animation: spin 3s linear infinite;
}

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

/* ===============================================
   Single Event Page - Hero Section
   =============================================== */

.single-csi_event .page-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.single-csi_event .page-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.65) 0%, rgba(215, 51, 51, 0.65) 100%);
    z-index: 1;
}

.single-csi_event .page-hero .container {
    position: relative;
    z-index: 2;
}

.single-csi_event .page-hero-content {
    color: #ffffff;
    padding: 40px 0;
}

.single-csi_event .event-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.single-csi_event .event-type-badge,
.single-csi_event .event-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    color: var(--color-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.single-csi_event .event-type-badge.event-type-online {
    background: rgba(30, 91, 168, 0.95);
    color: #ffffff;
}

.single-csi_event .event-type-badge.event-type-hybrid {
    background: rgba(215, 51, 51, 0.95);
    color: #ffffff;
}

.single-csi_event .event-type-badge.event-type-physical {
    background: rgba(34, 139, 34, 0.95);
    color: #ffffff;
}

.single-csi_event .recurring-event-badge svg {
    animation: spin 3s linear infinite;
}

.single-csi_event .event-type-badge:hover,
.single-csi_event .event-category-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.single-csi_event .page-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 15px 0;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.single-csi_event .page-hero-subtitle {
    font-size: 1.125rem;
    font-weight: 400;
    margin: 0 0 25px 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.95;
}

.single-csi_event .page-hero-subtitle svg {
    flex-shrink: 0;
}

.single-csi_event .back-to-events,
.single-news .back-to-events {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.single-csi_event .back-to-events:hover,
.single-news .back-to-events:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(-5px);
    text-decoration: none;
}

@media (max-width: 768px) {
    .single-csi_event .page-hero {
        min-height: 300px;
    }
    
    .single-csi_event .page-hero-title {
        font-size: 1.875rem;
    }
    
    .single-csi_event .page-hero-subtitle {
        font-size: 1rem;
    }
    
    .single-csi_event .event-type-badge,
    .single-csi_event .event-category-tag {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
}

/* ===============================================
   Event Cards - Recurring Indicators
   =============================================== */
.event-image.no-thumbnail {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 220px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 8px 0 0;
}

.event-image.no-thumbnail .recurring-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
}

/* Recurring Info Label */
.event-recurring-info {
    margin-bottom: 12px;
    padding: 8px 0;
}

.recurring-label {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===============================================
   Single Event - Recurring Info Box
   =============================================== */

.event-recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 1rem;
    border: 2px solid rgba(0, 123, 255, 0.3);
}

.event-recurring-badge svg {
    flex-shrink: 0;
}

.event-recurring-badge strong {
    color: #0056b3;
}

/* Recurring Badge in Hero */
.recurring-event-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px !important;
}

.recurring-event-badge svg {
    animation: spin 2s linear infinite;
}

/* ===============================================
   Upcoming Occurrences Sidebar Card
   =============================================== */

.recurring-schedule {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #1976d2;
}

.occurrence-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.occurrence-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.occurrence-list li:last-child {
    border-bottom: none;
}

.occurrence-list li svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: #1976d2;
}

.occurrence-list li span {
    flex: 1;
}

.occurrence-list li strong {
    color: #0d47a1;
    font-size: 0.95rem;
}

.occurrence-list li small {
    color: #555;
    font-size: 0.875rem;
}

/* ===============================================
   Admin Meta Box Styles
   =============================================== */

.acf-field[data-name="event_is_recurring"] {
    border-top: 2px solid #007bff;
    padding-top: 20px !important;
    margin-top: 20px !important;
}

.acf-field[data-name="event_is_recurring"] .acf-label label {
    font-size: 16px;
    font-weight: 600;
    color: #007bff;
}

.acf-field[data-name="recurrence_pattern"] select,
.acf-field[data-name="weekly_day"] select,
.acf-field[data-name="monthly_week"] select,
.acf-field[data-name="monthly_day"] select {
    font-size: 15px;
    padding: 8px 12px;
}

/* Conditional fields styling */
.acf-field[data-name="recurrence_pattern"],
.acf-field[data-name="weekly_day"],
.acf-field[data-name="monthly_week"],
.acf-field[data-name="monthly_day"],
.acf-field[data-name="recurrence_start"],
.acf-field[data-name="recurrence_end"],
.acf-field[data-name="event_time"],
.acf-field[data-name="event_duration"],
.acf-field[data-name="custom_dates"] {
    background: #f8f9fa;
    padding: 15px;
    border-left: 3px solid #dee2e6;
    margin-left: 0 !important;
}

/* Event List Card - Recurring Styles */
.event-list-card.recurring-event {
    position: relative;
}

.recurring-badge-small {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 6px;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.recurring-badge-small svg {
    animation: spin 2s linear infinite;
}

.event-recurring-label {
    margin-bottom: 8px;
}

.recurring-pattern {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===============================================
   Responsive Styles
   =============================================== */

@media (max-width: 768px) {
    .event-recurring-info-box {
        padding: 18px;
    }
    
    .recurring-pattern {
        flex-direction: column;
        gap: 12px;
    }
    
    .pattern-text {
        font-size: 1.1rem;
    }
    
    .recurring-details strong {
        font-size: 1rem;
    }
    .recurring-badge {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .event-recurring-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .recurring-label {
        font-size: 0.8rem;
        padding: 5px 12px;
    }
    
    .occurrence-list li {
        gap: 8px;
        padding: 10px 0;
    }
    
    .occurrence-list li strong {
        font-size: 0.9rem;
    }
    
    .occurrence-list li small {
        font-size: 0.8rem;
    }
}

/* ===============================================
   Print Styles
   =============================================== */

@media print {
    .recurring-badge {
        background: white !important;
        color: black !important;
        border: 2px solid black;
    }
    
    .event-recurring-badge {
        background: white !important;
        border-color: black !important;
    }
}

/* ===============================================
   Upcoming Occurrences Section
   =============================================== */

.upcoming-occurrences-section {
    margin: 50px 0;
    padding: 40px 0;
    border-top: 1px solid #e0e0e0;
}

.upcoming-occurrences-section h2 {
    font-size: 2rem;
    color: #1e5ba8;
    margin-bottom: 30px;
    font-weight: 700;
}

.occurrences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.occurrence-card {
    display: flex;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.occurrence-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(30, 91, 168, 0.15);
    border-color: #1e5ba8;
}

.occurrence-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.1) 0%, rgba(215, 51, 51, 0.1) 100%);
    border-radius: 8px;
    padding: 12px;
    min-width: 70px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.occurrence-card:hover .occurrence-date {
    border-color: #1e5ba8;
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.15) 0%, rgba(215, 51, 51, 0.15) 100%);
}

.date-day {
    font-size: 2rem;
    font-weight: 700;
    color: #1e5ba8;
    line-height: 1;
}

.date-month {
    font-size: 0.875rem;
    font-weight: 600;
    color: #d73333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.occurrence-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.occurrence-day-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.occurrence-full-date {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 8px 0;
}

.occurrence-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #1e5ba8;
    margin: 0;
    font-weight: 500;
}

.occurrence-time svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .occurrences-grid {
        grid-template-columns: 1fr;
    }
    
    .upcoming-occurrences-section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .occurrence-card {
        padding: 16px;
        gap: 16px;
    }
    
    .occurrence-date {
        min-width: 60px;
        padding: 10px;
    }
    
    .date-day {
        font-size: 1.75rem;
    }
    
    .date-month {
        font-size: 0.75rem;
    }
}
