/**
 * CSS Public pour Le Cadratin Calendar
 * Design neutre et professionnel, facilement personnalisable
 */

/* === Conteneur principal === */
.lcc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* === Boutons de changement de vue === */
.lcc-view-switcher {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.lcc-view-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin: 0 5px;
}

.lcc-view-btn:hover {
    color: #333;
}

.lcc-view-btn.active {
    color: #333;
    border-bottom-color: #333;
    font-weight: 600;
}

/* === VUE CALENDRIER === */
.lcc-calendar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.lcc-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.lcc-calendar-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.lcc-prev-month,
.lcc-next-month {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lcc-prev-month:hover,
.lcc-next-month:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

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

.lcc-day-header {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.lcc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.lcc-calendar-day {
    background: #fff;
    min-height: 100px;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.lcc-calendar-day:hover {
    background: #f8f9fa;
}

.lcc-calendar-day.other-month {
    background: #fafafa;
    color: #ccc;
}

.lcc-calendar-day.today {
    background: #fff9e6;
}

.lcc-day-number {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.lcc-calendar-day.other-month .lcc-day-number {
    color: #ccc;
}

.lcc-calendar-day.today .lcc-day-number {
    color: #ff6b35;
}

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

.lcc-calendar-event {
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 3px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    display: block;
    max-width: 100%;
    box-sizing: border-box;
}

.lcc-calendar-event:hover {
    opacity: 0.9;
}

.lcc-calendar-event.multi-day {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.2) 2px,
        rgba(255,255,255,0.2) 4px
    );
}

/* === VUE LISTE === */
.lcc-events-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.lcc-event-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-left: 4px solid #3788d8;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

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

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

.lcc-event-date {
    flex-shrink: 0;
    width: 120px;
    text-align: right;
}

.lcc-event-day {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.lcc-event-time {
    display: block;
    font-size: 14px;
    color: #666;
}

.lcc-event-allday {
    display: block;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.lcc-event-details {
    flex: 1;
}

.lcc-event-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.lcc-event-calendar {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.lcc-event-location {
    font-size: 14px;
    color: #666;
    margin-top: 6px;
}

/* === MODAL === */
.lcc-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lcc-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lcc-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.lcc-modal-close:hover {
    color: #333;
}

#lcc-event-details h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
}

#lcc-event-details p {
    margin: 10px 0;
    color: #666;
    line-height: 1.6;
}

#lcc-event-details .lcc-modal-calendar {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

#lcc-event-details .lcc-modal-datetime {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin: 15px 0;
}

#lcc-event-details .lcc-modal-location {
    color: #666;
    margin-top: 10px;
}

/* === MESSAGES === */
.lcc-error,
.lcc-empty {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
    color: #666;
    text-align: center;
}

.lcc-empty {
    border-left-color: #999;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .lcc-calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .lcc-day-number {
        font-size: 12px;
    }
    
    .lcc-calendar-event {
        font-size: 10px;
        padding: 1px 2px;
    }
    
    .lcc-event-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .lcc-event-date {
        width: 100%;
        text-align: left;
    }
    
    .lcc-modal-content {
        margin: 20% auto;
        padding: 20px;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .lcc-calendar-day {
        min-height: 60px;
        padding: 2px;
    }
    
    .lcc-day-events {
        display: none;
    }
    
    .lcc-calendar-day.has-events {
        background: #e3f2fd !important;
    }
    
    .lcc-calendar-day.has-events::after {
        content: "•";
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        color: #1976d2;
        font-size: 20px;
    }
}
