﻿/* === Base Card === */

.card-calendar {
    background-color: #efefef;
    border-radius: 5px;
    margin-bottom: 5px;
    margin-left: 1px;
    margin-right: 1px;
}

.time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: red;
    z-index: 100;
}

.time-dot {
    position: absolute;
    top: 50%;
    left: -5px;
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    transform: translateY(-50%);
    z-index: 101;
}

/* === DAY VIEW === */

.day-view {
    position: relative;
    display: block;
    flex-direction: column;
    border: 1px solid #ccc;
    height: 100%;
}

.hour-label {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    font-size: 12px;
    color: #666;
}

.hour-events {
    margin-left: 50px;
    position: relative;
    height: 100%;
}

/* === WEEK VIEW === */

.hour-slot {
    height: 60px;
    border-top: 1px solid #eee;
    position: relative;
    border-bottom: 1px solid #eee;
    padding-left: 60px; /* espaço para o horário */
    min-height: 50px; /* altura mínima para toque em mobile */
}

.week-day-body {
    position: relative;
    height: calc(24 * 60px);
}

.event-item {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s;
    position: absolute;
    left: 0;
    right: 10%;
    background: #4285f4;
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10pt;
    overflow: hidden;
    z-index: 1;
    border: 1px solid #3f6791;
}

    .event-item:hover {
        transform: scale(1.02);
        z-index: 10;
        position: absolute;
        left: 0;
        right: 10%;
        background: #4285f4;
        color: white;
        border-radius: 4px;
        padding: 2px 6px;
        font-size: 10pt;
        overflow: hidden;
        z-index: 1;
        border: 1px solid #3f6791;
    }


.week-view {
    display: flex;
    width: 100%;
    height: 100%;
    border: 1px solid #ccc;
}

.week-view-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
}

.week-time-column {
    border-right: 1px solid #ccc;
}

.week-day-column {
    border-left: 1px solid #ccc;
}

.week-day-header {
    padding: 8px;
    background: #f0f0f0;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .week-day-header .day-number {
        margin-top: 4px;
        width: 24px;
        height: 24px;
        line-height: 24px;
        border-radius: 50%;
        display: inline-block;
    }

        .week-day-header .day-number.today {
            background: #4285f4;
            color: #fff;
            font-weight: bold;
        }

.empty-header {
    height: 68px;
    background: transparent;
    border: none;
}

/* === MONTH VIEW === */
.month-view {
    /*display: flex;*/
    display: block;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.month-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center; /*addd*/
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.month-grid-header-day {
    text-align: center;
    font-weight: bold;
    padding: 8px 0;
    border-right: 1px solid #ddd;
}

.month-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 120px; /* altura das células do mês */
}

.month-cell {
    border: 1px solid #eee;
    padding: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 100px;
    box-sizing: border-box;
}

    .month-cell.other-month {
        background: #fafafa;
        color: #aaa;
    }

.month-cell-date {
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.month-cell-events {
    overflow-y: auto;
    flex-grow: 1;
}

.month-event-item {
    transition: transform 0.1s;
    background: #4285f4;
    color: white;
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 4px;
    margin-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

    .month-event-item:hover {
        transform: scale(1.02);
        background: #4285f4;
        color: white;
        border-radius: 4px;
        font-size: 11px;
        padding: 2px 4px;
        margin-top: 2px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

/* Responsivo */
@media (max-width: 768px) {
    .month-grid-header {
        grid-template-columns: repeat(7, minmax(30px, 1fr));
        font-size: 12px;
    }

    .month-grid-body {
        grid-template-columns: repeat(7, minmax(50px, 1fr));
    }

    .month-cell {
        min-height: 70px;
        padding: 3px;
    }

    .month-cell-date {
        font-size: 10px;
    }

    .month-event-item {
        font-size: 8px;
        padding: 1px 3px;
    }
}

@media (max-width: 480px) {
    .month-grid-header {
        grid-template-columns: repeat(7, 1fr);
        font-size: 10px;
    }

    .month-grid-body {
        grid-template-columns: repeat(7, 1fr);
    }

    .month-cell {
        min-height: 50px;
        padding: 2px;
    }

    .month-cell-date {
        font-size: 8px;
    }

    .month-event-item {
        font-size: 7px;
    }
}


/* === CALENDAR HEADER === */

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

    .calendar-header .header-left,
    .calendar-header .header-center,
    .calendar-header .header-right {
        display: flex;
        align-items: center;
    }

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
}

/* Ajusta espaçamento entre botões */
.calendar-header .btn-calendar {
    margin: 0 5px;
}

/* Centro: título e botões prev/next */
.calendar-header .header-center {
    flex: 1;
    justify-content: center;
    text-align: center;
    min-width: 200px; /* evita quebrar feio */
}

.calendar-header .selected-month {
    margin: 0 10px;
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
}

/* Direita: grupo de botões */
.calendar-header .header-right .btn-group .btn {
    margin-left: 5px;
}

/* Responsivo para telas pequenas */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        align-items: stretch; /* faz cada bloco ocupar toda a largura */
    }

        .calendar-header .header-left,
        .calendar-header .header-center,
        .calendar-header .header-right {
            justify-content: center;
            width: 100%;
        }

        .calendar-header .selected-month {
            font-size: 0.9rem;
            word-break: break-word; /* quebra se for muito longo */
        }

        .calendar-header .btn-group {
            flex-wrap: wrap;
            justify-content: center;
        }

            .calendar-header .btn-group .btn {
                margin: 5px;
            }
}

.header-center {
    gap: 10px;
    font-weight: bold;
    font-size: 16px;
}

.btn-calendar {
    background: none;
    border: none;
    padding: 6px 12px;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
}

    .btn-calendar:hover {
        background: #f0f0f0;
    }

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-month {
    min-width: 120px;
    text-align: center;
    text-transform: capitalize;
}


/* Responsividade para telas menores */
@media (max-width: 768px) {
    .hour-slot {
        padding-left: 45px;
        min-height: 40px;
    }

    .hour-label {
        width: 40px;
        font-size: 10px;
    }

    .event-card {
        font-size: 10px; /* se quiser diminuir o texto dos eventos */
    }
}
