/* Events Calendar Styles */

.calendar-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    padding: 20px;
}

/* Note: .calendar-main is defined in calendar.php inline styles */
.calendar-main {
    /* flex: 1; */
    /* display: flex; */
    /* flex-direction: column; */
    /* background: #1a1a1a; */
    /* border-radius: 8px; */
    /* padding: 20px; */
    /* overflow: hidden; */
}

.calendar-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.calendar-nav button {
    padding: 8px 12px;
    background: #333;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-nav button:hover {
    background: #444;
    border-color: #888;
}

#calendar-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #e0e0e0;
    min-width: 150px;
    text-align: center;
}

.view-modes {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.view-modes button {
    padding: 8px 12px;
    background: #333;
    border: 1px solid #555;
    color: #999;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

.view-modes button:hover {
    background: #444;
    color: #e0e0e0;
}

.view-modes button.active {
    background: #e85d75;
    border-color: #e85d75;
    color: white;
}

.calendar-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    color: #e0e0e0;
    font-size: 0.9em;
}

.filter-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-group input[type="text"] {
    padding: 8px 12px;
    background: #333;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 4px;
    min-width: 200px;
}

.filter-group input[type="text"]::placeholder {
    color: #999;
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #e85d75;
    background: #2a2a2a;
}

/* Calendar Grid Views */
#events-calendar {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Month View */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #333;
    padding: 1px;
    border: 1px solid #555;
}

.calendar-header {
    display: contents;
}

.calendar-header-cell {
    background: #2a2a2a;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    color: #e0e0e0;
    border-bottom: 2px solid #555;
}

.calendar-day {
    background: #2a2a2a;
    min-height: 100px;
    padding: 8px;
    color: #e0e0e0;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.2s;
}

.calendar-day:hover {
    background: #333;
}

.calendar-day.other-month {
    background: #1a1a1a;
    color: #666;
}

.calendar-day.today {
    background: #2a2a2a;
}

.calendar-day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-event {
    background: #e85d75;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    color: white;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background 0.2s;
}

.calendar-event:hover {
    background: #f07090;
}

.calendar-event.user-attending {
    background: #4caf50;
}

.calendar-event.user-attending:hover {
    background: #66bb6a;
}

.event-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Week View */
.calendar-week-grid {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #333;
    border: 1px solid #555;
    margin-bottom: 10px;
}

.week-day-header {
    background: #2a2a2a;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    color: #e0e0e0;
    border-bottom: 2px solid #555;
}

.calendar-week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    flex: 1;
    background: #333;
    border: 1px solid #555;
    overflow-y: auto;
}

.week-day {
    background: #2a2a2a;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 200px;
    overflow-y: auto;
}

.week-day.today {
    background: rgba(232, 93, 117, 0.1);
}

.week-day .calendar-event {
    padding: 6px;
    font-size: 0.75em;
}

.event-time {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 2px;
}

/* Day View */
.calendar-day-view {
    padding: 20px;
}

.calendar-day-view h3 {
    color: #e0e0e0;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-events .calendar-event {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.day-events .calendar-event:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(232, 93, 117, 0.3);
}

.day-events .event-location {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.no-events {
    color: #999;
    padding: 20px;
    text-align: center;
}

/* Year View */
.calendar-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
}

/* Mini Month View (for year display) */
.calendar-month-mini {
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px;
}

.month-title-mini {
    text-align: center;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 4px;
    font-size: 0.75em;
}

.month-grid-mini {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #333;
}

.month-header-cell-mini {
    text-align: center;
    font-size: 0.6em;
    font-weight: bold;
    color: #666;
    padding: 1px;
    background: #1a1a1a;
    min-height: auto;
}

.month-day-mini {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: #e0e0e0;
    position: relative;
    padding: 1px;
    overflow: hidden;
    font-size: 0.6em;
    cursor: pointer;
    transition: background 0.2s;
}

.month-day-mini:hover {
    background: #2a2a2a;
}

.month-day-mini.other {
    color: #666;
    background: #0a0a0a;
}

.month-day-mini.other:hover {
    background: #1a1a1a;
}

.day-number-mini {
    font-weight: bold;
    line-height: 1;
}

.event-indicator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    cursor: pointer;
    margin-top: 1px;
}

.event-indicator.attending {
    background: #4caf50;
    box-shadow: 0 0 3px #4caf50;
}

.event-indicator.not-attending {
    background: #e85d75;
    box-shadow: 0 0 3px #e85d75;
}

/* Day Zoom Modal */
.day-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    cursor: pointer;
}

.day-zoom-content {
    position: relative;
    z-index: 2001;
    background: #1a1a1a;
    border: 2px solid #e85d75;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(232, 93, 117, 0.3),
                0 0 60px rgba(232, 93, 117, 0.1);
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.day-zoom-modal.active .day-zoom-content {
    transform: scale(1);
    opacity: 1;
}

.day-zoom-header {
    background: linear-gradient(135deg, #e85d75 0%, #ff6b8a 100%);
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.day-zoom-header h3 {
    color: white;
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.day-zoom-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.day-zoom-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.day-zoom-events {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-zoom-event {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #e85d75;
    cursor: pointer;
    transition: all 0.2s;
}

.day-zoom-event.attending {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.08);
}

.day-zoom-event:hover {
    background: #333;
    transform: translateX(5px);
}

.day-zoom-event.attending:hover {
    background: rgba(76, 175, 80, 0.15);
}

.zoom-event-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.zoom-event-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.day-zoom-event.attending .zoom-event-indicator {
    background: #4caf50;
    box-shadow: 0 0 4px #4caf50;
}

.day-zoom-event.not-attending .zoom-event-indicator {
    background: #e85d75;
    box-shadow: 0 0 4px #e85d75;
}

.zoom-event-header h4 {
    color: white;
    margin: 0;
    font-size: 0.95em;
}

.zoom-event-time {
    color: #999;
    font-size: 0.85em;
    margin: 0;
}

.zoom-event-location {
    color: #666;
    font-size: 0.8em;
    margin: 0;
}

.zoom-event-description {
    color: #999;
    font-size: 0.85em;
    margin-top: 8px;
    margin-bottom: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.event-description {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.calendar-month {
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px;
}

.month-title {
    text-align: center;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #333;
}

.month-header-cell {
    text-align: center;
    font-size: 0.65em;
    font-weight: bold;
    color: #666;
    padding: 2px;
    background: #1a1a1a;
    min-height: auto;
}

.month-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    color: #e0e0e0;
    position: relative;
    padding: 2px;
    overflow: hidden;
}

.month-day-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    font-size: 0.75em;
}

.month-day-number {
    font-weight: bold;
    margin-bottom: 1px;
    min-height: 14px;
    line-height: 14px;
}

.month-day-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    overflow: hidden;
    font-size: 0.85em;
}

.month-day-events .calendar-event {
    padding: 1px 2px;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 1px;
    min-height: auto;
    line-height: 1.2;
}

.month-day-overflow {
    font-size: 0.7em;
    color: #999;
    margin-top: 1px;
}

.month-day.other {
    color: #666;
}

.month-day.has-events {
    background: #1a1a1a;
}

.month-day.user-attending {
    background: #1a1a1a;
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: #1a1a1a;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    z-index: 1000;
    transition: right 0.3s ease;
    border-left: 1px solid #555;
}

.detail-panel.open {
    right: 0;
}

.event-detail-header {
    background: #2a2a2a;
    padding: 20px;
    border-bottom: 1px solid #555;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.event-detail-header h2 {
    color: #e0e0e0;
    margin: 0;
    word-break: break-word;
    padding-right: 30px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #999;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #e0e0e0;
}

.event-detail-body {
    padding: 20px;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h4 {
    color: #e85d75;
    margin: 0 0 10px 0;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-section p {
    color: #e0e0e0;
    margin: 0;
    line-height: 1.5;
}

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

.attendee-list li {
    color: #e0e0e0;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

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

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #e85d75;
    color: white;
}

.btn-primary:hover {
    background: #f07090;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .calendar-year-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-panel {
        width: 350px;
        right: -350px;
    }
}

@media (max-width: 768px) {
    .calendar-container {
        flex-direction: column;
        gap: 10px;
        height: auto;
    }

    .calendar-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .view-modes {
        margin-left: 0;
        order: -1;
    }

    #calendar-title {
        order: -2;
    }

    .calendar-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group input[type="text"] {
        min-width: 100%;
    }

    .detail-panel {
        width: 100%;
        right: -100%;
    }

    .calendar-year-grid {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-day {
        min-height: 70px;
        padding: 5px;
    }

    .calendar-day-number {
        font-size: 0.9em;
    }

    .calendar-event {
        font-size: 0.7em;
        padding: 3px 4px;
    }
}
