/**
 * Frontend Calendar Styles
 * 
 * @package MarcCalendar
 */

/* Calendar Container */
.marc-calendar-container {
    max-width: 100%;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Loading State */
.marc-calendar-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.marc-calendar-loading p {
    margin: 0;
    font-size: 16px;
}

/* FullCalendar Customizations */
.fc {
    font-family: inherit;
}

.fc-header-toolbar {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.fc-button-group .fc-button {
    background: #fff;
    border: 1px solid #dee2e6;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s ease;
}

.fc-button-group .fc-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.fc-button-group .fc-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.fc-button-primary {
    background: #007bff !important;
    border-color: #007bff !important;
    color: #fff !important;
}

.fc-button-primary:hover {
    background: #0056b3 !important;
    border-color: #0056b3 !important;
}

.fc-button-primary:not(:disabled):active {
    background: #004085 !important;
    border-color: #003a75 !important;
}

.fc-toolbar-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #212529;
}

/* Day Grid Styles */
.fc-daygrid-day {
    transition: background-color 0.2s ease;
}

.fc-daygrid-day:hover {
    background-color: #f8f9fa;
}

.fc-daygrid-day-number {
    padding: 8px;
    font-weight: 500;
}

/* Event Styles */
.fc-event {
    border-radius: 4px;
    border: none !important;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Recurring Event Styles */
.fc-event[data-event*="recurring"] {
    border-left: 3px solid rgba(255, 255, 255, 0.8) !important;
    position: relative;
}

.fc-event[data-event*="recurring"]::before {
    content: "↻";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    opacity: 0.8;
    color: white;
    font-weight: bold;
}

.fc-event-title {
    font-weight: 500;
    padding: 0 4px;
}

.fc-event-time {
    font-weight: 600;
    opacity: 0.9;
}

/* Time Grid Styles */
.fc-timegrid-slot {
    height: 2.5em;
}

.fc-timegrid-slot-minor {
    border-top-style: dotted;
}

/* List View Styles */
.fc-list {
    border: 1px solid #ddd;
}

.fc-list-table {
    width: 100%;
}

.fc-list-day-cushion {
    background: #f8f9fa;
    padding: 8px 14px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.fc-list-event {
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #eee;
}

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

.fc-list-event-graphic {
    padding: 0 14px;
    width: 14px;
}

.fc-list-event-time {
    padding: 8px 14px;
    white-space: nowrap;
    width: 120px;
    font-weight: 500;
}

.fc-list-event-title {
    padding: 8px 14px 8px 0;
    font-weight: 500;
}

/* Ensure list view is properly contained */
.fc-list-view {
    overflow: visible;
}

/* Event List Styles */
.marc-event-list {
    margin: 20px 0;
}

.marc-event-list-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.marc-event-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.marc-event-list-content {
    padding: 20px;
}

.marc-event-list-title {
    margin: 0 0 10px 0;
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.3;
}

.marc-event-list-title a {
    text-decoration: none;
    color: #212529;
    transition: color 0.2s ease;
}

.marc-event-list-title a:hover {
    color: #007bff;
}

.marc-event-list-datetime {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    font-weight: 500;
    color: #495057;
}

.marc-event-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.marc-event-date::before {
    content: "📅";
    font-size: 14px;
}

.marc-event-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.marc-event-time::before {
    content: "🕐";
    font-size: 14px;
}

.marc-event-list-location {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 0.9em;
}

.marc-event-list-location .dashicons {
    font-size: 16px;
    line-height: 1;
}

.marc-event-list-excerpt {
    margin: 15px 0 0 0;
    color: #6c757d;
    line-height: 1.5;
}

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

/* Modal Styles */
.marc-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marc-modal-content {
    background-color: #fff;
    margin: 15px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.marc-modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #212529;
}

.marc-modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.marc-modal-close:hover {
    color: #000;
}

.marc-modal-body {
    padding: 20px 25px;
}

.marc-event-detail {
    margin-bottom: 15px;
}

.marc-event-detail:last-child {
    margin-bottom: 0;
}

.marc-event-detail-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.marc-event-detail-value {
    color: #212529;
    line-height: 1.5;
}

.marc-event-detail-value a {
    color: #007bff;
    text-decoration: none;
}

.marc-event-detail-value a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fc-header-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
    
    .fc-button-group {
        flex-wrap: wrap;
    }
    
    .fc-toolbar-title {
        font-size: 1.25em;
        text-align: center;
    }
    
    .marc-event-list-datetime {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .marc-modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .marc-modal-header,
    .marc-modal-body {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .marc-calendar-container {
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .fc-header-toolbar {
        padding: 10px 15px;
    }
    
    .fc-toolbar-title {
        font-size: 1.1em;
    }
    
    .marc-event-list-content {
        padding: 15px;
    }
    
    .marc-event-list-title {
        font-size: 1.1em;
    }
    
    .marc-modal-header h3 {
        font-size: 1.25em;
    }
}

/* Print Styles */
@media print {
    .marc-calendar-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .fc-header-toolbar {
        background: transparent;
        border-bottom: 2px solid #000;
    }
    
    .fc-button {
        display: none;
    }
    
    .marc-modal {
        display: none !important;
    }
}