/**
 * Style CSS dla kalendarza Abra Studio CRM
 * Lokalizacja: assets/css/calendar.css
 */

/* Kontener główny kalendarza */
.abra-calendar-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Kontrolki kalendarza */
.abra-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.abra-calendar-controls button {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.abra-calendar-controls button:hover {
    background: #135e96;
}

.abra-calendar-view-selector {
    display: flex;
    gap: 5px;
}

.abra-view-btn {
    background: #f6f7f7 !important;
    color: #1d2327 !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

.abra-view-btn.active,
.abra-view-btn:hover {
    background: #2271b1 !important;
    color: white !important;
}

.abra-calendar-export .button {
    background: #00a32a;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.abra-calendar-export .button:hover {
    background: #008a20;
    color: white;
}

/* Widok miesiąca */
.calendar-month {
    width: 100%;
}

.calendar-header {
    text-align: center;
    margin-bottom: 20px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 24px;
    color: #1d2327;
}

.calendar-grid {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f6f7f7;
}

.weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #646970;
    border-right: 1px solid #ddd;
}

.weekday:last-child {
    border-right: none;
}

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

.calendar-day {
    min-height: 120px;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    position: relative;
    background: #fff;
    transition: background-color 0.2s ease;
}

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

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

.calendar-day.other-month {
    background: #f6f7f7;
    color: #a7aaad;
}

.calendar-day.today {
    background: #e8f4fd;
    border: 2px solid #2271b1;
}

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

.day-events {
    max-height: 80px;
    overflow-y: auto;
}

.calendar-event {
    background: #2271b1;
    color: white;
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendar-event:hover {
    opacity: 0.8;
}

.event-time {
    font-weight: 600;
    font-size: 10px;
}

.event-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-status {
    font-size: 10px;
}

/* Widok tygodnia */
.calendar-week {
    width: 100%;
}

.week-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.time-column {
    background: #f6f7f7;
    border-right: 1px solid #ddd;
}

.time-slot {
    height: 60px;
    padding: 8px;
    font-size: 12px;
    color: #646970;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-column {
    border-right: 1px solid #ddd;
    min-width: 120px;
}

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

.day-header {
    background: #f6f7f7;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

.hour-slot {
    height: 60px;
    border-bottom: 1px solid #ddd;
    padding: 4px;
    position: relative;
}

.week-event {
    background: #2271b1;
    color: white;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    margin-bottom: 2px;
    transition: opacity 0.2s ease;
}

.week-event:hover {
    opacity: 0.8;
}

.week-event .event-time {
    font-weight: 600;
    font-size: 10px;
    margin-bottom: 2px;
}

.week-event .event-title {
    font-size: 11px;
    line-height: 1.2;
}

/* Widok listy */
.calendar-list {
    width: 100%;
}

.events-list {
    max-height: 600px;
    overflow-y: auto;
}

.no-events {
    text-align: center;
    padding: 40px;
    color: #646970;
    font-style: italic;
    font-size: 16px;
}

.events-date-group {
    margin-bottom: 30px;
}

.events-date {
    background: #f6f7f7;
    padding: 10px 15px;
    margin: 0 0 15px 0;
    border-left: 4px solid #2271b1;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.list-event {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s ease;
}

.list-event:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.list-event .event-time {
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 5px;
}

.list-event .event-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 8px;
}

.list-event .event-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #646970;
}

.event-instructor,
.event-location,
.event-participants {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Ładowanie */
.calendar-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #646970;
}

.calendar-loading::before {
    content: '⏳';
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

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

/* Responsywność */
@media (max-width: 768px) {
    .abra-calendar-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .abra-calendar-view-selector {
        justify-content: center;
    }
    
    .calendar-days {
        grid-template-columns: 1fr;
    }
    
    .calendar-day {
        min-height: auto;
        padding: 15px;
    }
    
    .week-grid {
        grid-template-columns: 1fr;
    }
    
    .time-column {
        display: none;
    }
    
    .day-column {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .list-event .event-details {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .abra-calendar-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 8px;
    }
    
    .calendar-event {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .list-event {
        padding: 12px;
    }
    
    .list-event .event-title {
        font-size: 16px;
    }
    
    .calendar-header h3 {
        font-size: 20px;
    }
}

/* Kolory wydarzeń według statusu */
.calendar-event[style*="#d63638"] {
    /* Anulowane - czerwony */
    background: #d63638 !important;
}

.calendar-event[style*="#dba617"] {
    /* Pełne - żółty */
    background: #dba617 !important;
}

.calendar-event[style*="#f56e28"] {
    /* Prawie pełne - pomarańczowy */
    background: #f56e28 !important;
}

.calendar-event[style*="#3788d8"] {
    /* Aktywne - niebieski */
    background: #3788d8 !important;
}

/* Tooltips */
[title] {
    cursor: help;
}

/* Animacje */
.calendar-event,
.week-event,
.list-event {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fokus dla dostępności */
.abra-calendar-controls button:focus,
.abra-view-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .abra-calendar-controls {
        display: none;
    }
    
    .abra-calendar-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .calendar-event,
    .week-event {
        background: #000 !important;
        color: #fff !important;
    }
}