/* Event Calendar Styles */

.event-calendar-container {
    margin: 20px 0;
}

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

.calendar-nav-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.calendar-nav-btn:hover {
    background: #0056b3;
}

.calendar-title {
    margin: 0;
    font-size: 1.5em;
    color: #2c3e50;
}

.calendar-view-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.view-btn {
    padding: 8px 20px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: #dee2e6;
}

.view-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Day Selector */
.calendar-day-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.day-selector-label {
    font-weight: 600;
    color: #495057;
    margin-right: 5px;
}

.day-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.day-checkbox-label:hover {
    background: #e9ecef;
}

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

.day-checkbox-label span {
    font-size: 14px;
    color: #495057;
}

/* Weekend View - Time-Based Layout */
.calendar-weekend-view {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    padding: 20px;
}

.calendar-time-layout {
    padding: 0;
}

.schedule-actions {
    margin-bottom: 20px;
    text-align: right;
}

.btn-submit-event {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-submit-event:hover {
    background: #0056b3;
    color: white;
}

.time-schedule-container {
    display: flex;
    flex-direction: column;
}

.day-section {
    margin-bottom: 30px;
}

.day-section:last-child {
    margin-bottom: 0;
}

.day-header {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

.time-slot-group {
    display: flex;
    margin-bottom: 15px;
    position: relative;
}

.time-slot-group:last-child {
    margin-bottom: 0;
}

.time-column {
    width: 120px;
    flex-shrink: 0;
    position: relative;
    padding-right: 15px;
}

.time-label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    padding: 8px 0;
    white-space: nowrap;
}

.time-line {
    position: absolute;
    left: 100px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
    z-index: 1;
    height: 100%;
}

.events-column {
    flex: 1;
    padding-left: 20px;
    padding-bottom: 10px;
}

.event-item {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.event-item:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.event-day-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-right: 8px;
    min-width: 60px;
    text-align: center;
}

.event-link {
    text-decoration: none;
    color: #212529;
    display: block;
}

.event-title {
    font-weight: 600;
    font-size: 15px;
}

.overlap-indicator {
    display: inline-block;
    margin-left: 8px;
    color: #dc3545;
    font-size: 12px;
}

.no-events-message {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Event Detail View (Inline) */
.event-detail-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.btn-back-schedule {
    display: inline-block;
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-back-schedule:hover {
    background: #5a6268;
    color: white;
}

.event-detail-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event-detail-title {
    font-size: 2em;
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.event-detail-meta {
    margin-bottom: 30px;
}

.meta-item {
    margin-bottom: 15px;
    line-height: 1.6;
}

.meta-item strong {
    display: inline-block;
    width: 120px;
    color: #495057;
}

.event-detail-description {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.event-detail-description h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.event-detail-description p {
    line-height: 1.8;
    color: #495057;
}

.event-detail-rsvp {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.rsvp-status {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 0;
}

.badge-full {
    display: inline-block;
    padding: 4px 8px;
    background: #dc3545;
    color: white;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.badge-available {
    display: inline-block;
    padding: 4px 8px;
    background: #28a745;
    color: white;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* Submission Page */
.event-submission-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.submission-page-actions {
    margin-bottom: 20px;
    text-align: right;
}

.submission-form-actions {
    margin-bottom: 20px;
    text-align: right;
}

.btn-view-schedule {
    display: inline-block;
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-view-schedule:hover {
    background: #5a6268;
    color: white;
}

.btn-submit-event-inline {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-bottom: 20px;
}

.btn-submit-event-inline:hover {
    background: #0056b3;
    color: white;
}

.weekend-header {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #e1e5e9;
}

.weekend-day-header {
    padding: 15px;
    text-align: center;
    border-right: 1px solid #e1e5e9;
}

.weekend-day-header:last-child {
    border-right: none;
}

.weekend-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.weekend-day {
    border-right: 1px solid #e1e5e9;
    position: relative;
}

.weekend-day:last-child {
    border-right: none;
}

.weekend-timeline {
    position: relative;
    padding: 10px;
    height: 800px; /* Fixed height for 16 hours (8 AM to 12 AM) at 50px per hour */
    overflow: visible; /* Allow events to be visible even if they extend slightly */
}

.weekend-time-slot {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    min-height: 50px;
    position: relative;
}

.weekend-time-slot .time-label {
    width: 80px;
    padding: 5px;
    font-weight: 600;
    color: #6c757d;
    flex-shrink: 0;
    font-size: 0.85em;
}

.weekend-time-slot .time-events {
    flex: 1;
    position: relative;
    padding: 2px;
    min-height: 50px; /* Match min-height of time-slot */
    /* Ensure no events are rendered here - they're in the timeline container */
    pointer-events: none;
}

/* Day View */
.calendar-day-view {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
}

.calendar-day-view h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.day-timeline {
    position: relative;
}

.time-slot {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    min-height: 60px;
    position: relative;
}

.time-label {
    width: 100px;
    padding: 10px;
    font-weight: 600;
    color: #6c757d;
    flex-shrink: 0;
}

.time-events {
    flex: 1;
    position: relative;
    padding: 5px;
}

.calendar-event {
    position: absolute;
    left: 0;
    background: #007bff;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
    overflow: hidden;
    box-sizing: border-box;
}

.weekend-event {
    /* Events in weekend view are positioned relative to weekend-timeline */
    /* Left position already accounts for time label area via percentage calculation */
}

.calendar-event:hover {
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.calendar-event.has-overlap {
    background: #dc3545;
}

.calendar-event .event-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.calendar-event .event-time {
    font-size: 0.9em;
    opacity: 0.9;
}

.overlap-indicator {
    font-size: 0.8em;
    margin-top: 2px;
    font-weight: 600;
}

.duration-display {
    color: #6c757d;
    font-size: 0.9em;
    margin-left: 5px;
}

/* Week View */
.calendar-week-view {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #e1e5e9;
}

.week-day-header {
    padding: 15px;
    text-align: center;
    border-right: 1px solid #e1e5e9;
}

.week-day-header:last-child {
    border-right: none;
}

.day-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.day-date {
    color: #6c757d;
    font-size: 0.9em;
}

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

.week-day {
    min-height: 400px;
    padding: 10px;
    border-right: 1px solid #e1e5e9;
    border-bottom: 1px solid #e1e5e9;
    position: relative;
}

.week-day:last-child {
    border-right: none;
}

.week-event {
    background: #007bff;
    color: white;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.week-event:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.week-event.has-overlap {
    background: #dc3545;
}

.week-event .event-time {
    font-weight: 600;
    margin-bottom: 3px;
}

.week-event .event-title {
    font-size: 0.9em;
}

/* Month View */
.calendar-month-view {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #e1e5e9;
}

.month-day-header {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    border-right: 1px solid #e1e5e9;
}

.month-day-header:last-child {
    border-right: none;
}

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

.month-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid #e1e5e9;
    border-bottom: 1px solid #e1e5e9;
    position: relative;
}

.month-day:nth-child(7n) {
    border-right: none;
}

.month-day.today {
    background: #e7f3ff;
}

.month-day.empty {
    background: #f8f9fa;
}

.day-number {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.month-day.today .day-number {
    background: #007bff;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
}

.day-events {
    font-size: 0.75em;
}

.month-event {
    background: #007bff;
    color: white;
    padding: 3px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.month-event:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.month-event.has-overlap {
    background: #dc3545;
}

.overlap-indicator {
    display: inline-block;
    margin-left: 3px;
}

.more-events {
    color: #6c757d;
    font-size: 0.8em;
    margin-top: 3px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-view-selector {
        flex-wrap: wrap;
    }
    
    .time-label {
        width: 80px;
        font-size: 0.85em;
    }
    
    .weekend-header,
    .weekend-body {
        grid-template-columns: 1fr;
    }
    
    .weekend-day-header,
    .weekend-day {
        border-right: none;
    }
    
    .week-header,
    .week-body {
        grid-template-columns: 1fr;
    }
    
    .week-day-header,
    .week-day {
        border-right: none;
    }
    
    .month-body {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .month-day {
        min-height: 60px;
        font-size: 0.7em;
    }
}

