/* Islamic Calendar Styles */
/* Version: 2.0 - Full calendar UI with panels */

/* Calendar Section */
.calendar-section {
    padding: 165px 20px 110px;
    min-height: 100vh;
    width: 100%;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* Header - Fixed at top */
.calendar-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 428px;
    z-index: 90;
}

.dark-mode .calendar-header {
    background: rgba(45, 55, 72, 0.95);
}

.calendar-header .back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #4CAF50;
    font-size: 18px;
}

.calendar-header .back-btn:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: scale(1.05);
}

.calendar-header h2 {
    font-size: 24px;
    font-weight: bold;
    color: #2d5016;
    margin: 0;
    flex: 1;
    text-align: center;
}

.dark-mode .calendar-header h2 {
    color: #4CAF50;
}

/* Content Area */
.calendar-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 80px;
}

/* Panel Base Style */
.calendar-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

.dark-mode .calendar-panel {
    background: rgba(45, 55, 72, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   Current Date Panel
   ============================================================================ */

.current-date-panel {
    text-align: center;
    padding: 25px 20px;
}

.current-hijri-date {
    font-size: 28px;
    font-weight: 700;
    color: #2d5016;
    margin-bottom: 6px;
}

.dark-mode .current-hijri-date {
    color: #4CAF50;
}

.current-gregorian-date {
    font-size: 16px;
    color: #666;
    margin-bottom: 12px;
}

.dark-mode .current-gregorian-date {
    color: #999;
}

.religious-day-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.religious-day-badge.eid {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.religious-day-badge.fasting {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.religious-day-badge.special {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

/* ============================================================================
   Calendar Controls Panel
   ============================================================================ */

.calendar-controls-panel {
    padding: 20px;
}

/* Top Row: View Toggle + Madhab Toggle */
.controls-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

/* Hijri/Gregorian View Toggle */
.view-toggle-container {
    flex: 1;
}

.slider-toggle {
    position: relative;
    display: inline-flex;
    background: #e0e0e0;
    border-radius: 25px;
    padding: 4px;
    width: 100%;
    max-width: 280px;
}

.dark-mode .slider-toggle {
    background: rgba(255, 255, 255, 0.1);
}

.slider-toggle input {
    display: none;
}

.slider-toggle label {
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
    z-index: 1;
    flex: 1;
    text-align: center;
}

.dark-mode .slider-toggle label {
    color: #999;
}

.slider-toggle input:checked + label {
    color: white;
}

.slider-background {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.slider-toggle input#gregorian-view:checked ~ .slider-background {
    transform: translateX(100%);
}

/* Madhab Toggle Button */
.madhab-toggle-container {
    display: flex;
    align-items: center;
}

.madhab-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(76, 175, 80, 0.1);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    color: #4CAF50;
    white-space: nowrap;
}

.dark-mode .madhab-toggle-btn {
    background: rgba(76, 175, 80, 0.15);
}

.madhab-toggle-btn:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: scale(1.05);
}

.madhab-toggle-btn:active {
    transform: scale(0.98);
}

.madhab-toggle-btn i.fa-mosque {
    font-size: 14px;
}

.madhab-toggle-btn i.fa-sync-alt {
    font-size: 12px;
}

/* Month/Year Selector */
.month-year-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.month-nav-btn {
    background: #4CAF50;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-nav-btn:hover {
    background: #45a049;
    transform: scale(1.1);
}

.month-year-dropdowns {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.dropdown-select {
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 140px;
}

.dark-mode .dropdown-select {
    background: rgba(45, 55, 72, 0.9);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

.dropdown-select:hover {
    border-color: #4CAF50;
}

.dropdown-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* ============================================================================
   Calendar Grid Panel
   ============================================================================ */

.calendar-grid-panel {
    padding: 20px;
}

.calendar-grid {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.dark-mode .calendar-grid {
    background: rgba(45, 55, 72, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.dark-mode .calendar-weekdays {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.weekday {
    padding: 12px;
    text-align: center;
    font-weight: 700;
    color: #666;
    font-size: 14px;
}

.dark-mode .weekday {
    color: #999;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.dark-mode .calendar-days {
    background: rgba(255, 255, 255, 0.1);
}

.calendar-day {
    background: white;
    padding: 12px 8px;
    text-align: center;
    min-height: 85px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.dark-mode .calendar-day {
    background: rgba(45, 55, 72, 0.5);
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode .calendar-day:hover {
    background: rgba(76, 175, 80, 0.1);
}

.calendar-day.empty {
    background: #fafafa;
    cursor: default;
}

.dark-mode .calendar-day.empty {
    background: rgba(255, 255, 255, 0.02);
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.day-hijri {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.dark-mode .day-hijri {
    color: #e0e0e0;
}

.day-gregorian {
    font-size: 11px;
    color: #999;
    font-weight: 500;
}

.dark-mode .day-gregorian {
    color: #666;
}

.day-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 4px;
}

/* Special Days */
.calendar-day.today {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.calendar-day.today .day-hijri,
.calendar-day.today .day-gregorian {
    color: white;
}

.calendar-day.eid {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.calendar-day.eid .day-hijri,
.calendar-day.eid .day-gregorian {
    color: white;
}

.calendar-day.hajj {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

.calendar-day.hajj .day-hijri,
.calendar-day.hajj .day-gregorian {
    color: white;
}

.calendar-day.fasting {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.calendar-day.fasting .day-hijri,
.calendar-day.fasting .day-gregorian {
    color: white;
}

.calendar-day.special {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.calendar-day.special .day-hijri,
.calendar-day.special .day-gregorian {
    color: #333;
}

.calendar-day.shia-event {
    background: linear-gradient(135deg, #00C853 0%, #00A843 100%);
}

.calendar-day.shia-event .day-hijri,
.calendar-day.shia-event .day-gregorian {
    color: white;
}

.calendar-day.historical {
    background: linear-gradient(135deg, #795548 0%, #5D4037 100%);
}

.calendar-day.historical .day-hijri,
.calendar-day.historical .day-gregorian {
    color: white;
}

.calendar-day.ramadan {
    background: linear-gradient(135deg, #673AB7 0%, #512DA8 100%);
}

.calendar-day.ramadan .day-hijri,
.calendar-day.ramadan .day-gregorian {
    color: white;
}

.calendar-day.laylat-qadr {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.calendar-day.laylat-qadr .day-hijri,
.calendar-day.laylat-qadr .day-gregorian {
    color: #333;
    font-weight: 800;
}

.calendar-day.recommended-fast {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
}

.calendar-day.recommended-fast .day-hijri,
.calendar-day.recommended-fast .day-gregorian {
    color: white;
}

/* ============================================================================
   Important Dates & Upcoming Events Panels
   ============================================================================ */

.important-dates-panel,
.upcoming-events-panel {
    padding: 20px;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dark-mode .panel-title {
    color: #e0e0e0;
}

.panel-title i {
    color: #4CAF50;
}

.date-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Date/Event Item */
.date-item,
.event-item {
    border-radius: 12px;
    background: #f8f9fa;
    overflow: hidden;
    transition: all 0.2s;
}

.dark-mode .date-item,
.dark-mode .event-item {
    background: rgba(255, 255, 255, 0.05);
}

.date-item {
    border-left: 4px solid #4CAF50;
}

.event-item {
    border-left: 4px solid #4CAF50;
}

.date-item-header,
.event-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.date-item-header:hover,
.event-item-header:hover {
    background: rgba(76, 175, 80, 0.05);
}

.dark-mode .date-item-header:hover,
.dark-mode .event-item-header:hover {
    background: rgba(76, 175, 80, 0.1);
}

.date-icon,
.event-icon {
    font-size: 24px;
    margin-top: 2px;
}

.date-info,
.event-details {
    flex: 1;
}

.date-name,
.event-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 15px;
}

.dark-mode .date-name,
.dark-mode .event-name {
    color: #e0e0e0;
}

.date-detail {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.dark-mode .date-detail {
    color: #999;
}

.date-gregorian,
.event-date {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

.dark-mode .date-gregorian,
.dark-mode .event-date {
    color: #666;
}

/* Expand/Collapse Arrow */
.expand-arrow {
    color: #4CAF50;
    font-size: 18px;
    transition: transform 0.3s;
    margin-top: 2px;
}

.date-item.expanded .expand-arrow,
.event-item.expanded .expand-arrow {
    transform: rotate(180deg);
}

/* Event-specific (for upcoming events) */
.event-item-header {
    justify-content: space-between;
}

.event-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.event-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.event-countdown {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Explanation Section (Collapsible) */
.date-explanation,
.event-explanation {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.dark-mode .date-explanation,
.dark-mode .event-explanation {
    background: rgba(45, 55, 72, 0.5);
}

.date-item.expanded .date-explanation,
.event-item.expanded .event-explanation {
    max-height: 500px;
}

.explanation-content {
    padding: 14px;
    border-top: 1px solid #e0e0e0;
}

.dark-mode .explanation-content {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.explanation-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.dark-mode .explanation-text {
    color: #b0b0b0;
}

.explanation-significance {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    border-left: 3px solid #4CAF50;
}

.dark-mode .explanation-significance {
    background: rgba(255, 255, 255, 0.05);
    color: #999;
}

/* ============================================================================
   Legend Panel
   ============================================================================ */

.legend-panel {
    padding: 8px 12px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
}

.dark-mode .legend-item {
    color: #999;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 600px) {
    .calendar-section {
        padding: 96px 16px 100px;
    }

    .calendar-header {
        padding: 12px;
        max-width: calc(100% - 32px);
    }

    .calendar-header h2 {
        font-size: 20px;
    }

    .current-hijri-date {
        font-size: 22px;
    }

    .current-gregorian-date {
        font-size: 14px;
    }

    .calendar-controls-panel {
        padding: 12px;
    }

    .controls-top-row {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 12px;
    }

    .view-toggle-container {
        flex: 1;
        min-width: 0;
    }

    .slider-toggle {
        max-width: 100%;
        padding: 3px;
    }

    .slider-toggle label {
        padding: 8px 12px;
        font-size: 12px;
    }

    .madhab-toggle-container {
        flex-shrink: 0;
    }

    .madhab-toggle-btn {
        padding: 8px 12px;
        font-size: 11px;
        gap: 6px;
        white-space: nowrap;
    }

    .madhab-toggle-btn i.fa-mosque {
        font-size: 12px;
    }

    .madhab-toggle-btn i.fa-sync-alt {
        font-size: 10px;
    }

    .month-year-selector {
        gap: 8px;
    }

    .month-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .month-year-dropdowns {
        flex-direction: row;
        gap: 8px;
        flex: 1;
    }

    .dropdown-select {
        min-width: 0;
        font-size: 13px;
        padding: 8px 10px;
    }

    #monthSelect {
        flex: 2;
    }

    #yearSelect {
        flex: 1;
    }

    .calendar-day {
        min-height: 70px;
        padding: 6px 4px;
    }

    .day-hijri {
        font-size: 16px;
    }

    .day-gregorian {
        font-size: 10px;
    }
}

/* Madhab Badge Styles */
.madhab-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    vertical-align: middle;
}

.dark-mode .madhab-badge {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.4);
}

/* Event Indicator Dots on Calendar Grid */
.calendar-day.has-event {
    position: relative;
}

.event-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dark-mode .event-indicator {
    box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}
