/* Public Calendar Styles */
.ecb-public-calendar {
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ecb-calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.ecb-prev-month,
.ecb-next-month {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.ecb-prev-month:hover,
.ecb-next-month:hover {
    background: #005a87;
}

.ecb-month-display {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    flex: 1;
    word-wrap: break-word;
}

.ecb-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    flex-wrap: wrap;
}

.ecb-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ecb-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.ecb-calendar-grid {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.ecb-calendar-wrapper {
    min-width: 600px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.ecb-calendar-header {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    gap: 8px;
    margin-bottom: 10px;
}

.ecb-day-name {
    text-align: center;
    font-weight: 600;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    color: #333;
    border: 1px solid transparent;
}

.ecb-calendar-days {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    gap: 8px;
}

.ecb-day {
    min-height: 100px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    background: #fff;
    transition: box-shadow 0.2s;
}

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

.ecb-day-empty {
    background: #fafafa;
    border: 1px solid #f0f0f0;
}

.ecb-day-number {
    font-weight: 600;
    margin-bottom: 8px;
    padding: 2px 5px;
    color: #333;
    font-size: 14px;
}

.ecb-day-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Reduce slot gaps on mobile */
@media (max-width: 768px) {
    .ecb-day-slots {
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .ecb-day-slots {
        gap: 2px;
    }
}

.ecb-slot {
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    color: #fff;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
    position: relative;
}

.ecb-slot span {
    display: block;
    line-height: 1.2;
}

/* Tooltip for full name on hover/touch */
.ecb-slot::after {
    content: attr(data-slot);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
    margin-bottom: 5px;
}

.ecb-slot:hover::after,
.ecb-slot:active::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ecb-calendar-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .ecb-public-calendar {
        padding: 10px 5px;
        margin: 0;
    }

    .ecb-calendar-wrapper {
        min-width: 0;
    }

    .ecb-calendar-grid {
        padding: 10px 5px;
    }

    .ecb-month-display {
        font-size: 18px;
    }

    .ecb-calendar-header {
        gap: 2px;
    }

    .ecb-calendar-days {
        gap: 2px;
    }

    .ecb-day {
        min-height: 80px;
        padding: 3px;
    }

    .ecb-day-number {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .ecb-day-name {
        padding: 3px;
        font-size: 12px;
        border: 1px solid transparent;
    }

    .ecb-slot {
        padding: 2px 0;
        font-size: 9px;
        min-height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ecb-slot span {
        font-size: 9px;
        line-height: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
        padding: 0;
    }

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

    .ecb-month-display {
        font-size: 18px;
    }

    .ecb-prev-month,
    .ecb-next-month {
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ecb-public-calendar {
        padding: 5px 2px;
    }

    .ecb-calendar-grid {
        padding: 5px 2px;
        border-left: none;
        border-right: none;
    }


    .ecb-month-display {
        font-size: 14px;
        line-height: 1.2;
    }

    .ecb-calendar-header {
        gap: 1px;
    }

    .ecb-calendar-days {
        gap: 1px;
    }

    .ecb-day {
        min-height: 65px;
        padding: 2px;
    }

    .ecb-day-number {
        font-size: 10px;
    }

    .ecb-slot {
        padding: 1px 0;
        font-size: 7px;
        min-height: 18px;
    }

    .ecb-slot span {
        font-size: 7px;
        line-height: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
        padding: 0;
    }

    /* Show tooltip on touch/tap for mobile */
    .ecb-slot:active::after {
        opacity: 1;
    }

    .ecb-day-name {
        padding: 2px;
        font-size: 10px;
        border: 1px solid transparent;
    }

    .ecb-legend {
        flex-direction: column;
        gap: 8px;
    }
}
