/* LASA Events Calendar Styles */

.lasa-events-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
	z-index: 9999 !important;
	position: relative;
}

/* Loading Spinner */
.lasa-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Event Legend */
.event-legend {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-title {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.legend-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* Header Controls */
.lasa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.lasa-nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    background: #007cba;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.nav-btn:hover {
    background: #005a87;
}

.nav-btn:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

.current-period {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    min-width: 200px;
    text-align: center;
}

.lasa-view-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #e0e0e0;
}

.control-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.view-toggle {
    display: flex;
    background: #f0f0f0;
    border-radius: 6px;
    padding: 2px;
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

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

.view-btn:not(.active):hover {
    background: #e0e0e0;
}

/* Filters Panel */
.filters-panel {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filters-content {
    padding: 20px;
}

.filters-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.filter-group {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-group h4 {
    margin: 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.filter-group h4:hover {
    background: #e9ecef;
}

.filter-group h4::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.2s;
}

.filter-group.collapsed h4::after {
    transform: rotate(-90deg);
}

.checkbox-group {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 0;
    transition: max-height 0.3s ease;
}

.filter-group.collapsed .checkbox-group {
    max-height: 0;
    overflow: hidden;
    padding: 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 8px;
}

.checkbox-item:hover {
    background: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #007cba;
}

.checkbox-icon {
    font-size: 16px;
    line-height: 1;
}

.checkbox-label {
    font-size: 14px;
    color: #495057;
    line-height: 1.2;
}

.no-options {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

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

.btn-primary:hover {
    background: #005a87;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Calendar Grid */
.calendar-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
	position: relative;
}

.calendar-grid {
    display: grid;
    grid-template-rows: auto 1fr;
}

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

.day-header {
    padding: 15px 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    border-right: 1px solid #e9ecef;
}

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

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

.calendar-day {
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    min-height: 120px;
    padding: 8px;
    background: white;
    position: relative;
}

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

.calendar-day.other-month {
    background: #f8f9fa;
    color: #6c757d;
}

.calendar-day.today {
    background: #e3f2fd;
}

.day-number {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

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

.event-item {
    color: white;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.event-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-item:focus {
    outline: 2px solid #004570;
    outline-offset: 1px;
}

.event-icon {
    font-size: 10px;
    line-height: 1;
    flex-shrink: 0;
}

/* Event Color Classes */
.event-item.event-lasa {
    background: #1e40af;
}

.event-item.event-lasa:hover {
    background: #1e3a8a;
}

.event-item.event-member {
    background: #059669;
}

.event-item.event-member:hover {
    background: #047857;
}

.event-item.event-national {
    background: #dc2626;
}

.event-item.event-national:hover {
    background: #b91c1c;
}


.event-more {
    font-size: 11px;
    color: #666;
    text-align: center;
    padding: 2px;
    cursor: pointer;
}

.event-more:hover {
    color: #007cba;
}

/* List View */
.list-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.events-list {
    display: flex;
    flex-direction: column;
}

.list-event-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}

.list-event-item:hover {
    background: #f8f9fa;
}

.list-event-item:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

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

.list-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.list-event-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-event-title .event-icon {
    font-size: 18px;
    line-height: 1;
}

.list-event-date {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.list-event-details {
    color: #555;
    line-height: 1.5;
}

.list-event-location {
    color: #007cba;
    font-size: 14px;
    margin-top: 5px;
}

.list-event-tags {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.event-tag {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Event Modal */
.event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background: #f0f0f0;
}

.close-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.modal-body {
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.modal-event-image {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 15px;
}

.modal-event-details {
    display: grid;
    gap: 15px;
}

.modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-detail-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.modal-detail-value {
    color: #555;
    line-height: 1.5;
}

.modal-event-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
}

.modal-btn-primary {
    background: #007cba;
    color: white;
}

.modal-btn-primary:hover {
    background: #005a87;
    color: white;
}

.no-events {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lasa-events-container {
        padding: 10px;
    }
    
    .lasa-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .lasa-nav-controls {
        justify-content: center;
    }
    
    .lasa-view-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .current-period {
        font-size: 20px;
        min-width: auto;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .event-item {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .list-event-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .list-event-title {
        font-size: 16px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header {
        padding: 15px 15px 0 15px;
    }
    
    .modal-body {
        padding: 0 15px 15px 15px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .modal-event-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        justify-content: center;
    }
    
    .filter-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .calendar-body {
        min-height: 300px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 2px;
    }
    
    .day-events {
        gap: 1px;
    }
    
    .event-item {
        font-size: 9px;
        padding: 1px 2px;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .current-period {
        font-size: 18px;
    }
    
    .view-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .calendar-day {
        border-width: 2px;
    }
    
    .event-item {
        border: 1px solid #000;
    }
    
    .nav-btn:focus,
    .view-btn:focus,
    .control-btn:focus {
        outline: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }
    
    .nav-btn,
    .view-btn,
    .control-btn,
    .event-item,
    .list-event-item,
    .modal-btn {
        transition: none;
    }
    
    .filters-panel {
        transition: none;
    }
}

/* Focus management */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    .lasa-header,
    .filters-panel,
    .event-modal {
        display: none !important;
    }
    
    .calendar-container,
    .list-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .calendar-day {
        border: 1px solid #000;
    }
    
    .event-item {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000;
    }
}