/* Church Calendar Frontend Styles */

.church-calendar-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 15px;
}

.nav-btn {
    padding: 10px 20px;
    background: #d62828;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #b51f1f;
}

/* Month Selector */
.month-selector-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.current-month-year {
    background: white;
    border: 2px solid #d62828;
    color: #333;
    font-size: 20px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    min-width: 200px;
    justify-content: center;
}

.current-month-year:hover {
    background: #fef5f5;
    border-color: #b51f1f;
}

.current-month-year.active {
    background: #d62828;
    color: white;
}

.current-month-year.active .chevron-icon {
    transform: rotate(180deg);
}

.chevron-icon {
    transition: transform 0.3s;
    flex-shrink: 0;
}

.month-year-text {
    margin: 0;
}

/* Dropdown */
.month-selector-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid #d62828;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 320px;
    animation: dropdownSlideIn 0.3s ease-out;
    pointer-events: auto;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.dropdown-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 700;
}

.dropdown-close {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-close:hover {
    background: #e0e0e0;
}

/* Year Selector */
.year-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.year-nav {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
}

.year-nav:hover {
    background: #d62828;
    color: white;
    border-color: #d62828;
}

.current-year-display {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    min-width: 60px;
    text-align: center;
}

/* Months Grid */
.months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px 20px;
}

.month-option {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 12px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.month-option:hover {
    background: #fef5f5;
    border-color: #d62828;
    color: #d62828;
}

.month-option.active {
    background: #d62828;
    color: white;
    border-color: #d62828;
}

.month-option.current-month {
    border-color: #d62828;
    color: #d62828;
    font-weight: 700;
}

/* Dropdown Footer */
.dropdown-footer {
    padding: 15px 20px;
    border-top: 2px solid #f0f0f0;
}

.jump-to-today {
    width: 100%;
    background: #d62828;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.jump-to-today:hover {
    background: #b51f1f;
}

.church-calendar {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.calendar-month-name {
    font-size: 48px;
    color: #d62828;
    text-align: center;
    padding: 30px 20px 20px;
    font-weight: 300;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
}

.day-header {
    background: #f5e6e6;
    padding: 15px 5px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    color: #333;
}

.day-header.sunday {
    color: #d62828;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 8px;
    position: relative;
}

.calendar-day.empty {
    background: #fafafa;
}

.calendar-day.sunday .day-number {
    color: #d62828;
    font-weight: 700;
}

.calendar-day.has-events {
    cursor: pointer;
}

.day-number {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

/* Desktop Events Display */
.events-desktop {
    display: block;
}

.events-mobile {
    display: none;
}

.event-item {
    font-size: 11px;
    padding: 4px 6px;
    margin: 3px 0;
    border-radius: 3px;
    line-height: 1.3;
    font-weight: 600;
    word-wrap: break-word;
    cursor: pointer;
    transition: opacity 0.2s;
}

.event-item:hover {
    opacity: 0.8;
}

/* Mobile Event Dots */
.event-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 0 2px;
}

.event-more {
    font-size: 10px;
    font-weight: 700;
    color: #666;
    margin-left: 2px;
}

/* Event Modal */
.event-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.event-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease-in-out;
}

.event-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.event-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: background 0.2s;
}

.event-modal-close:hover {
    background: #e0e0e0;
}

.event-modal-header {
    padding: 20px 20px 15px;
    border-bottom: 2px solid #e0e0e0;
}

.event-modal-month-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.event-modal-subtitle {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

.event-modal-body {
    padding: 15px;
    max-height: calc(70vh - 90px);
    overflow-y: auto;
}

/* Event Cards */
.event-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.event-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.event-card.highlighted {
    background: #fff9e6;
    border: 2px solid #d62828;
    box-shadow: 0 4px 12px rgba(214, 40, 40, 0.15);
}

.event-card-date {
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-card.highlighted .event-card-date {
    background: #d62828;
    color: white;
    border-bottom: none;
}

.event-date-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-date-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: #333;
}

.event-card.highlighted .event-date-day {
    color: white;
}

.event-date-text {
    display: flex;
    flex-direction: column;
}

.event-date-weekday {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    line-height: 1.2;
}

.event-card.highlighted .event-date-weekday {
    color: rgba(255,255,255,0.9);
}

.event-date-month {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
}

.event-card.highlighted .event-date-month {
    color: rgba(255,255,255,0.8);
}

.event-count-badge {
    background: #e0e0e0;
    color: #666;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.event-card.highlighted .event-count-badge {
    background: rgba(255,255,255,0.3);
    color: white;
}

.event-card-content {
    padding: 0;
}

.event-item-card {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.event-item-card:last-child {
    border-bottom: none;
}

.event-card.highlighted .event-item-card {
    border-bottom-color: rgba(214, 40, 40, 0.1);
}

.event-color-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
}

.event-item-content {
    padding-left: 12px;
}

.modal-event-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.modal-event-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.modal-event-type {
    display: inline-block;
    font-size: 11px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: #666;
}

.event-card.highlighted .modal-event-type {
    background: rgba(214, 40, 40, 0.1);
    color: #d62828;
}

/* Empty state */
.events-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.events-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.events-empty-text {
    font-size: 16px;
    font-weight: 600;
}

.modal-event-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
}

.modal-event-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.modal-event-type {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 12px;
    margin-top: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Calendar Footer */
.calendar-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.footer-section {
    min-width: 0;
}

.calendar-footer h3 {
    color: #d62828;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-content {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.footer-content p {
    margin: 8px 0;
}

.footer-content ul,
.footer-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.footer-content ul li {
    margin: 5px 0;
    list-style-type: disc;
}

.footer-content ol li {
    margin: 5px 0;
    list-style-type: decimal;
}

.footer-content strong {
    font-weight: 700;
}

.footer-content em {
    font-style: italic;
}

.footer-content a {
    color: #d62828;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: #b51f1f;
    text-decoration: underline;
}

/* Loading State */
.calendar-loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .church-calendar-wrapper {
        padding: 10px;
    }
    
    .calendar-month-name {
        font-size: 32px;
        padding: 20px 10px 10px;
    }
    
    .calendar-navigation {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-btn {
        flex: 1;
        min-width: calc(50% - 5px);
        order: 2;
    }
    
    .month-selector-wrapper {
        order: 1;
        flex: 1 1 100%;
        margin-bottom: 5px;
    }
    
    .current-month-year {
        font-size: 18px;
        padding: 10px 16px;
        min-width: 100%;
    }
    
    .month-selector-dropdown {
        left: 10px;
        right: 10px;
        transform: none;
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
    
    @keyframes dropdownSlideIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .months-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px 15px;
    }
    
    .month-option {
        padding: 10px 6px;
        font-size: 13px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 5px;
    }
    
    .day-number {
        font-size: 16px;
        margin-bottom: 3px;
    }
    
    .day-header {
        padding: 10px 3px;
        font-size: 14px;
    }
    
    /* Hide desktop events, show mobile dots */
    .events-desktop {
        display: none;
    }
    
    .events-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 3px;
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .event-dot {
        width: 5px;
        height: 5px;
    }
    
    .calendar-footer {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .calendar-navigation {
        padding: 12px;
    }
    
    .current-month-year {
        font-size: 16px;
        padding: 8px 12px;
    }
    
    .chevron-icon {
        width: 14px;
        height: 14px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .month-selector-dropdown {
        left: 5px;
        right: 5px;
        max-width: calc(100vw - 30px);
    }
    
    .dropdown-header {
        padding: 12px 15px;
    }
    
    .dropdown-header h4 {
        font-size: 15px;
    }
    
    .year-selector {
        padding: 12px 15px;
    }
    
    .current-year-display {
        font-size: 16px;
    }
    
    .year-nav {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .months-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 10px 12px;
    }
    
    .month-option {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .dropdown-footer {
        padding: 12px 15px;
    }
    
    .jump-to-today {
        padding: 10px;
        font-size: 13px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 4px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .event-dot {
        width: 4px;
        height: 4px;
    }
    
    .event-more {
        font-size: 9px;
    }
}

@media (max-width: 360px) {
    .current-month-year {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .nav-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .months-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
    
    .month-option {
        padding: 6px 2px;
        font-size: 11px;
    }
}
