/* ========== TOUR CALENDAR STYLES ========== */

/* Desktop: Fixed Sidebar on Right */
.tour-calendar-sidebar {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 100px);
    background: linear-gradient(145deg, rgba(26, 31, 36, 0.98), rgba(42, 52, 57, 0.95));
    border-radius: 16px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 107, 53, 0.1),
        inset 0 0 30px rgba(0, 0, 0, 0.2);
    z-index: 100;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-calendar-sidebar.collapsed {
    width: 50px;
}

.tour-calendar-sidebar.collapsed .tour-calendar-content,
.tour-calendar-sidebar.collapsed .tour-calendar-title span:last-child {
    display: none;
}

.tour-calendar-sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* Calendar Header */
.tour-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(181, 55, 242, 0.15));
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
}

.tour-calendar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.calendar-icon {
    font-size: 1.2rem;
}

.calendar-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-toggle-btn:hover {
    background: rgba(255, 107, 53, 0.3);
}

.toggle-icon {
    color: #fff;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* Calendar Content */
.tour-calendar-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

/* Month Navigation */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.cal-nav-btn {
    background: rgba(255, 107, 53, 0.2);
    border: 1px solid rgba(255, 107, 53, 0.3);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.cal-nav-btn:hover {
    background: rgba(255, 107, 53, 0.4);
    transform: scale(1.05);
}

.cal-month-year {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Calendar Grid */
.calendar-grid {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 15px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    padding: 5px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    cursor: default;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-day.other-month {
    color: rgba(255, 255, 255, 0.2);
}

.calendar-day.today {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 800;
}

.calendar-day.has-event {
    cursor: pointer;
    font-weight: 800;
    color: #fff;
}

.calendar-day.has-event:hover {
    transform: scale(1.15);
    z-index: 2;
}

/* Travel Intensity Colors */
.calendar-day.intensity-none {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.calendar-day.intensity-low {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.calendar-day.intensity-medium {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.calendar-day.intensity-high {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.calendar-day.intensity-extreme {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    animation: pulse-extreme 2s ease-in-out infinite;
}

@keyframes pulse-extreme {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.9); }
}

/* Event Dot Indicator */
.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
}

/* Legend */
.calendar-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.legend-title {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.legend-scale {
    display: flex;
    gap: 4px;
    flex: 1;
}

.legend-item {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    cursor: help;
}

.legend-item.low { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.legend-item.medium { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.legend-item.high { background: linear-gradient(90deg, #f97316, #ea580c); }
.legend-item.extreme { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* Upcoming Shows List */
.calendar-upcoming {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.upcoming-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.upcoming-item:hover {
    background: rgba(255, 107, 53, 0.15);
    transform: translateX(3px);
}

.upcoming-item.intensity-low { border-left-color: #3b82f6; }
.upcoming-item.intensity-medium { border-left-color: #f59e0b; }
.upcoming-item.intensity-high { border-left-color: #ea580c; }
.upcoming-item.intensity-extreme { border-left-color: #dc2626; }

.upcoming-date {
    min-width: 40px;
    text-align: center;
}

.upcoming-date .day {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.upcoming-date .month {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.upcoming-info {
    flex: 1;
    min-width: 0;
}

.upcoming-venue {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-city {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.upcoming-distance {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

/* No Events State */
.calendar-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
}

.calendar-empty-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.calendar-empty p {
    font-size: 0.85rem;
}

/* Event Popup */
.calendar-event-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 350px;
    background: linear-gradient(145deg, rgba(26, 31, 36, 0.98), rgba(42, 52, 57, 0.95));
    border-radius: 16px;
    border: 2px solid rgba(255, 107, 53, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    overflow: hidden;
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25), rgba(181, 55, 242, 0.2));
    border-bottom: 1px solid rgba(255, 107, 53, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.popup-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: rgba(255, 107, 53, 0.3);
}

.popup-content {
    padding: 20px;
}

.popup-detail {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.popup-detail-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.popup-detail-text {
    flex: 1;
}

.popup-detail-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.popup-intensity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 5px;
}

.popup-intensity.low { background: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.popup-intensity.medium { background: rgba(245, 158, 11, 0.3); color: #fbbf24; }
.popup-intensity.high { background: rgba(234, 88, 12, 0.3); color: #f97316; }
.popup-intensity.extreme { background: rgba(220, 38, 38, 0.3); color: #ef4444; }

.popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.popup-btn.edit {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
}

.popup-btn.edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.popup-btn.close {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.popup-btn.close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Overlay */
.tour-calendar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
}

.tour-calendar-overlay.active {
    display: block;
}

/* Mobile Close Button */
.calendar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.calendar-close-btn:hover {
    background: rgba(255, 107, 53, 0.3);
}

/* Desktop/Mobile visibility helpers */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* Mobile Calendar Button */
.mobile-calendar-btn {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: none;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s ease;
}

.mobile-calendar-btn:hover {
    transform: scale(1.1);
}

.cal-btn-icon {
    font-size: 1.5rem;
}

.cal-btn-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    background: #ef4444;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.cal-btn-badge:empty,
.cal-btn-badge[data-count="0"] {
    display: none;
}

/* Mobile Styles */
@media (max-width: 1200px) {
    .tour-calendar-sidebar {
        right: 10px;
        width: 260px;
    }
}

@media (max-width: 900px) {
    .tour-calendar-sidebar {
        display: none;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        z-index: 200;
    }

    .tour-calendar-sidebar.mobile-open {
        display: block;
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .tour-calendar-sidebar.collapsed {
        width: 100%;
    }

    /* Show overlay when calendar is open on mobile */
    .tour-calendar-overlay.active {
        display: block;
    }

    /* Hide desktop toggle, show mobile close */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .calendar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tour-calendar-header {
        padding: 15px 20px;
    }

    .tour-calendar-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    .mobile-calendar-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tour-calendar-content {
        max-height: calc(70vh - 60px);
    }

    .calendar-day {
        font-size: 0.85rem;
    }
}

/* Calendar only shows when public-settings-view is active */
/* The sidebar is nested inside public-settings-view, so it inherits visibility */
