/* =====================================================
   TACTICO - Calendar & Schedule Styles
   Event management and attendance tracking styling
   ===================================================== */

/* =====================================================
   PAGE LAYOUT
   ===================================================== */

.calendar-page {
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Main Content Layout - 3 column */
.calendar-main {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 0;
    height: calc(100vh - 110px);
    min-height: 500px;
}

/* Right panel collapsed by default */
.calendar-main.panel-closed {
    grid-template-columns: 280px 1fr;
}

.calendar-main.panel-closed .calendar-right-panel {
    display: none;
}

/* =====================================================
   LEFT SIDEBAR
   ===================================================== */

.calendar-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

/* Mini Calendar */
.mini-calendar {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 12px;
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mini-calendar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-calendar-nav {
    display: flex;
    gap: 4px;
}

.mini-calendar-nav button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-calendar-nav button:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mini-calendar-day-header {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0;
}

.mini-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mini-calendar-day:hover {
    background: var(--bg-hover);
}

.mini-calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.5;
}

.mini-calendar-day.today {
    background: rgba(0, 212, 170, 0.2);
    color: var(--accent-primary);
    font-weight: 600;
}

.mini-calendar-day.selected {
    background: var(--accent-primary);
    color: #000;
    font-weight: 600;
}

.mini-calendar-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: var(--accent-secondary);
    border-radius: 50%;
}

.mini-calendar-day {
    position: relative;
}

/* Team Filter */
.team-filter-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-filter-select:hover {
    border-color: var(--accent-primary);
}

.team-filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

/* New Event Button */
.btn-new-event {
    width: 100%;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a8ff 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-new-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.btn-new-event:active {
    transform: translateY(0);
}

.btn-new-event svg {
    width: 18px;
    height: 18px;
}

/* Legend */
.calendar-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.training {
    background: #00d4aa;
}

.legend-dot.match {
    background: #00a8ff;
}

.legend-dot.meeting {
    background: #f39c12;
}

.legend-dot.other {
    background: #9b59b6;
}

/* =====================================================
   MAIN CALENDAR
   ===================================================== */

.calendar-content {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

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

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.calendar-nav-btn svg {
    width: 18px;
    height: 18px;
}

.calendar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 200px;
    text-align: center;
}

.calendar-today-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-today-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* View Toggle */
.calendar-view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
}

.view-toggle-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    color: var(--text-primary);
}

.view-toggle-btn.active {
    background: var(--accent-primary);
    color: #000;
}

/* Calendar Grid */
.calendar-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.calendar-day-header {
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
}

.calendar-day {
    min-height: 120px;
    background: var(--bg-secondary);
    padding: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.calendar-day:hover {
    background: var(--bg-tertiary);
}

.calendar-day.other-month {
    background: var(--bg-primary);
}

.calendar-day.other-month .day-number {
    color: var(--text-muted);
    opacity: 0.5;
}

.calendar-day.today {
    background: rgba(0, 212, 170, 0.05);
}

.calendar-day.today .day-number {
    background: var(--accent-primary);
    color: #000;
}

.calendar-day.selected {
    background: rgba(0, 168, 255, 0.1);
    box-shadow: inset 0 0 0 2px var(--accent-secondary);
}

.day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 50%;
    margin-bottom: 4px;
}

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

.day-event {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.15s ease;
}

.day-event:hover {
    transform: translateX(2px);
}

.day-event.training {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border-left: 3px solid #00d4aa;
}

.day-event.match {
    background: rgba(0, 168, 255, 0.2);
    color: #00a8ff;
    border-left: 3px solid #00a8ff;
}

.day-event.meeting {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border-left: 3px solid #f39c12;
}

.day-event.other {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
    border-left: 3px solid #9b59b6;
}

.day-more {
    font-size: 10px;
    color: var(--text-muted);
    padding: 2px 8px;
}

/* Week View */
.calendar-week-view {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.calendar-week-view.active {
    display: flex;
}

.calendar-grid-container.week-view .calendar-grid {
    display: none;
}

.week-day-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.week-day-label {
    padding: 16px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.week-day-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.week-day-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.week-day-row.today .week-day-number {
    color: var(--accent-primary);
}

.week-day-events {
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 60px;
    align-items: flex-start;
    align-content: flex-start;
}

.week-event {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-event:hover {
    transform: translateY(-2px);
}

.week-event.training {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.week-event.match {
    background: rgba(0, 168, 255, 0.2);
    color: #00a8ff;
    border: 1px solid rgba(0, 168, 255, 0.3);
}

.week-event.meeting {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.week-event.other {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.week-event-time {
    font-size: 11px;
    opacity: 0.8;
}

/* =====================================================
   RIGHT PANEL - EVENT DETAILS
   ===================================================== */

.calendar-right-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Empty Panel State */
.panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 24px;
}

.panel-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.panel-empty h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-empty p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Event Details */
.event-detail {
    display: none;
}

.event-detail.active {
    display: block;
}

.event-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.event-type-badge.training {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

.event-type-badge.match {
    background: rgba(0, 168, 255, 0.2);
    color: #00a8ff;
}

.event-type-badge.meeting {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.event-type-badge.other {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.event-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.event-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.event-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.event-info-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 8px;
    flex-shrink: 0;
}

.event-info-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
}

.event-info-content {
    flex: 1;
}

.event-info-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.event-info-value {
    font-size: 14px;
    color: var(--text-primary);
}

.event-notes {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.event-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-actions .btn {
    justify-content: center;
}

/* Attendance Summary in Event Details */
.attendance-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.attendance-summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attendance-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.attendance-stat {
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    text-align: center;
}

.attendance-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.attendance-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.attendance-stat.present .attendance-stat-value {
    color: #00d4aa;
}

.attendance-stat.absent .attendance-stat-value {
    color: #e74c3c;
}

.attendance-stat.late .attendance-stat-value {
    color: #f39c12;
}

.attendance-stat.excused .attendance-stat-value {
    color: #9b59b6;
}

/* =====================================================
   MODALS
   ===================================================== */

/* Event Modal Form */
.event-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.event-form .form-row.triple {
    grid-template-columns: 1fr 1fr 1fr;
}

.event-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.event-type-option {
    padding: 12px 8px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-type-option:hover {
    border-color: var(--text-muted);
}

.event-type-option.selected {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.1);
}

.event-type-option input {
    display: none;
}

.event-type-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.event-type-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.event-type-option.selected .event-type-label {
    color: var(--accent-primary);
}

/* Attendance Modal */
.attendance-modal .modal {
    max-width: 600px;
}

.attendance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.attendance-event-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.attendance-event-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.btn-mark-all {
    padding: 8px 16px;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-mark-all:hover {
    background: #00e6b8;
}

.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.attendance-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.attendance-player-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.attendance-player-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.attendance-player-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.attendance-status-toggle {
    display: flex;
    gap: 4px;
}

.status-btn {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.status-btn:hover {
    border-color: var(--text-muted);
}

.status-btn.active {
    border-color: transparent;
}

.status-btn.present.active {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

.status-btn.absent.active {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.status-btn.late.active {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.status-btn.excused.active {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

/* =====================================================
   LOADING & EMPTY STATES
   ===================================================== */

.calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
}

.calendar-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.calendar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.calendar-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.calendar-empty h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-empty p {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: var(--text-muted);
    max-width: 300px;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 1200px) {
    .calendar-main {
        grid-template-columns: 240px 1fr 280px;
    }
}

@media (max-width: 1024px) {
    .calendar-main {
        grid-template-columns: 220px 1fr;
    }

    .calendar-right-panel {
        position: fixed;
        right: 0;
        top: 110px;
        bottom: 0;
        width: 320px;
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .calendar-main.panel-open .calendar-right-panel {
        transform: translateX(0);
    }

    .calendar-main.panel-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
}

@media (max-width: 768px) {
    /* Header and nav bar styles handled by mobile.css */

    /* Main layout - single column on mobile */
    .calendar-main {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 60px);
        min-height: 0;
    }

    .calendar-main.panel-closed {
        grid-template-columns: 1fr;
    }

    /* Hide sidebar by default on mobile */
    .calendar-sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 60px;
        bottom: 0;
        width: 280px;
        z-index: 200;
        background: var(--bg-secondary);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .calendar-main.sidebar-open .calendar-sidebar {
        display: flex;
        transform: translateX(0);
    }

    /* Overlay when sidebar open */
    .calendar-main.sidebar-open::before {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

    /* Calendar content fills remaining space */
    .calendar-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    /* Compact header on mobile */
    .calendar-header {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 12px;
        min-height: auto;
    }

    .calendar-nav {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    .calendar-nav-btn {
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .calendar-nav-btn svg {
        width: 16px;
        height: 16px;
    }

    .calendar-title {
        font-size: 14px;
        min-width: 0;
        flex: 1;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .calendar-today-btn {
        display: none;
    }

    .calendar-view-toggle {
        flex-shrink: 0;
        padding: 2px;
    }

    .view-toggle-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Calendar grid container */
    .calendar-grid-container {
        flex: 1;
        padding: 8px;
        overflow-y: auto;
        min-height: 0;
    }

    /* Calendar grid - make it compact */
    .calendar-grid {
        border-radius: 8px;
    }

    .calendar-day-header {
        padding: 8px 4px;
        font-size: 10px;
    }

    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }

    .day-number {
        width: 22px;
        height: 22px;
        font-size: 11px;
        margin-bottom: 2px;
    }

    .day-events {
        gap: 2px;
    }

    .day-event {
        font-size: 8px;
        padding: 2px 4px;
        border-left-width: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .day-more {
        font-size: 9px;
        padding: 1px 4px;
    }

    /* Week view on mobile */
    .week-day-row {
        grid-template-columns: 70px 1fr;
    }

    .week-day-label {
        padding: 10px 8px;
    }

    .week-day-name {
        font-size: 10px;
    }

    .week-day-number {
        font-size: 18px;
    }

    .week-day-events {
        padding: 8px;
        gap: 6px;
    }

    .week-event {
        padding: 6px 8px;
        font-size: 11px;
    }

    .week-event-time {
        font-size: 9px;
    }

    /* Right panel as full-screen overlay on mobile */
    .calendar-right-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 300;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .calendar-main.panel-open .calendar-right-panel {
        transform: translateX(0);
    }

    .panel-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        background: var(--bg-secondary);
        z-index: 10;
    }

    .panel-content {
        padding: 16px;
        overflow-y: auto;
    }

    /* Event modal on mobile */
    .event-type-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .event-type-option {
        padding: 10px 6px;
    }

    .event-type-icon {
        font-size: 20px;
    }

    .event-form .form-row,
    .event-form .form-row.triple {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Attendance modal on mobile */
    .attendance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-mark-all {
        width: 100%;
    }

    .attendance-player {
        flex-wrap: wrap;
        gap: 8px;
    }

    .attendance-status-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .status-btn {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        font-size: 10px;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

.calendar-main.sidebar-open .sidebar-overlay {
    display: block;
}

/* Sidebar mobile header */
.sidebar-mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.sidebar-mobile-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

@media (max-width: 768px) {
    .sidebar-mobile-header {
        display: flex;
    }
}

/* Mobile menu toggle buttons */
.mobile-menu-toggles {
    display: none;
    padding: 10px 12px;
    gap: 8px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.mobile-toggle-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mobile-toggle-btn:hover {
    border-color: var(--accent-primary);
}

@media (max-width: 768px) {
    .mobile-menu-toggles {
        display: flex;
    }
}

/* =====================================================
   LOCATION AUTOCOMPLETE
   ===================================================== */

.location-autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.location-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.location-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-color);
}

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

.location-item:hover,
.location-item.active {
    background: var(--bg-hover);
}

.location-icon {
    flex-shrink: 0;
    color: var(--accent-primary);
    margin-top: 2px;
}

.location-text {
    flex: 1;
    min-width: 0;
}

.location-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.location-address {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Add to Calendar Button */
.btn-add-calendar {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(52, 168, 83, 0.15));
    border-color: rgba(66, 133, 244, 0.4);
}

.btn-add-calendar:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.25), rgba(52, 168, 83, 0.25));
    border-color: rgba(66, 133, 244, 0.6);
}
