/* ============================================================================
   HR ZONE — Calendar Styles
   Navigation, day cells, events, filters, grid layouts
   ============================================================================ */

/* --- Calendar Navigation Button --- */
#calendar-nav-btn {
    color: #4b5563;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

#calendar-nav-btn:hover {
    background-color: #f3f4f6;
}

/* --- Mini Calendar Day Cells --- */
#simple-calendar-weekdays {
    color: #6b7280;
}

#simple-calendar-days-grid .day-cell {
    padding: 8px 0;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#simple-calendar-days-grid .day-cell.other-month {
    color: #9ca3af;
}

#simple-calendar-days-grid .day-cell:not(.today):not(.selected):hover {
    background-color: #f9fafb;
    border-radius: 50%;
}

#simple-calendar-days-grid .day-cell.selected {
    background-color: #f3f4f6;
    color: #111827;
    border-radius: 50%;
    font-weight: 600;
}

#simple-calendar-days-grid .day-cell.today {
    background-color: #1a1a1a;
    color: white;
    border-radius: 50%;
    font-weight: 700;
}

/* --- Calendar Event Items --- */
#day-events-list .event-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#day-events-list .event-item:hover {
    background-color: #f9fafb;
}

#day-events-list .event-item .event-time {
    font-weight: 600;
    color: #1f2937;
    flex-shrink: 0;
    width: 50px;
}

#day-events-list .event-item .event-details {
    flex-grow: 1;
}

#day-events-list .event-item .event-title {
    font-weight: 600;
    color: #1f2937;
}

#day-events-list .event-item .event-type-note {
    color: #4b5563;
    font-size: 12px;
}

#day-events-list .event-item.task {
    border-left: 4px solid var(--brand-red);
}

#day-events-list .event-item.note {
    border-left: 4px solid #3b82f6;
}

/* --- Calendar Filter Buttons --- */
.calendar-filter-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    background-color: #f3f4f6;
    transition: all 0.2s ease;
}

.calendar-filter-btn:hover {
    background-color: #e5e7eb;
}

.calendar-filter-btn.active {
    background-color: #1a1a1a;
    color: white;
}

.dashboard-tab#calendar-content {
    height: calc(100dvh - 73px);
    max-height: calc(100dvh - 73px);
}

#calendar-content .bg-white.rounded-2xl {
    height: 100%;
}

.calendar-weekday-strip {
    flex-shrink: 0;
}

.calendar-weekday-strip-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.calendar-weekday-cell {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px 14px 0 0;
    padding: 12px 10px;
    text-align: center;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- Calendar Grid Layouts --- */
.calendar-grid-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    background: #f3f4f6;
    align-content: start;
}

.calendar-body-shell.is-month-view #calendar-grid-scroll-region {
    overflow: hidden;
}

.calendar-body-shell.is-month-view .calendar-grid-month {
    height: 100%;
    min-height: 0;
    grid-template-rows: repeat(6, minmax(0, 1fr));
    align-content: stretch;
}

.calendar-grid-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    background: #f3f4f6;
    align-content: start;
}

.calendar-grid-day {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    background: #f3f4f6;
    align-content: start;
}

/* --- Calendar Day Card --- */
.calendar-day-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    min-height: 150px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.calendar-day-card:hover {
    border-color: #fecaca;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.calendar-day-card.is-selected {
    border-color: #d81f26;
    box-shadow: 0 0 0 2px rgba(216, 31, 38, 0.14);
}

.calendar-day-card.is-other-month {
    background: #f9fafb;
    opacity: 0.75;
}

.calendar-day-card.is-placeholder {
    background: transparent;
    border: 1px dashed transparent;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

.calendar-day-skeleton {
    pointer-events: none;
}

.calendar-day-skeleton .calendar-day-card-body,
.calendar-day-skeleton .calendar-day-events {
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.calendar-day-card.is-today {
    border-color: #fca5a5;
}

.calendar-day-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.calendar-grid-month .calendar-day-card {
    min-height: 0;
    height: 100%;
    justify-content: flex-start;
}

.calendar-grid-month .calendar-day-card-header {
    margin-bottom: 0;
}

.calendar-grid-month .calendar-day-events {
    display: none;
}

.calendar-grid-month .calendar-day-add-btn {
    opacity: 0.18;
}

.calendar-grid-month .calendar-day-card:hover .calendar-day-add-btn,
.calendar-grid-month .calendar-day-card:focus-within .calendar-day-add-btn,
.calendar-grid-month .calendar-day-card.is-selected .calendar-day-add-btn {
    opacity: 1;
}

.calendar-grid-month .calendar-day-number {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.calendar-grid-month .calendar-day-card.is-placeholder .calendar-day-number,
.calendar-grid-month .calendar-day-card.is-placeholder .calendar-day-add-btn,
.calendar-grid-month .calendar-day-card.is-placeholder .calendar-day-card-body {
    visibility: hidden;
}

.calendar-grid-month .calendar-day-card-body {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    min-height: 22px;
}

.calendar-month-indicators {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 12px;
}

.calendar-month-indicator {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.calendar-month-indicator.is-training {
    background: #d81f26;
}

.calendar-month-indicator.is-event {
    background: #2563eb;
}

.calendar-month-indicator.is-mixed {
    background: #111827;
}

.calendar-month-indicator.is-completed {
    background: #16a34a;
}

.calendar-month-indicator.is-proposed {
    background: #111827;
}

.calendar-grid-week .calendar-day-card,
.calendar-grid-day .calendar-day-card {
    min-height: 180px;
}

.calendar-day-number {
    width: 30px;
    height: 30px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
}

.calendar-day-card.is-today .calendar-day-number {
    background: #d81f26;
    color: #ffffff;
}

.calendar-day-week-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.08em;
}

.calendar-day-add-btn {
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-day-add-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #d81f26;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.calendar-details-panel {
    background:
        radial-gradient(circle at top right, rgba(254, 226, 226, 0.7), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.calendar-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-details-empty {
    min-height: 220px;
    border: 1px dashed #e5e7eb;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.calendar-detail-item {
    width: 100%;
    text-align: left;
    border-radius: 18px;
    border: 1px solid transparent;
    padding: 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.calendar-detail-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.calendar-detail-skeleton {
    pointer-events: none;
}

.calendar-detail-skeleton:hover {
    transform: none;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.calendar-detail-item.training {
    border-color: #fecaca;
}

.calendar-detail-item.event {
    border-color: #bfdbfe;
}

.calendar-detail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.calendar-detail-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.calendar-detail-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.calendar-detail-badge.training {
    background: #fef2f2;
    color: #b91c1c;
}

.calendar-detail-badge.event {
    background: #eff6ff;
    color: #1d4ed8;
}

.calendar-detail-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin-bottom: 6px;
}

.calendar-detail-copy {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

@media (max-width: 1279px) {
    .calendar-details-panel {
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 767px) {
    .dashboard-tab#calendar-content {
        height: auto;
        max-height: none;
    }

    .calendar-weekday-strip {
        padding-left: 8px;
        padding-right: 8px;
        padding-top: 8px;
    }

    .calendar-weekday-strip-grid {
        gap: 8px;
    }

    .calendar-weekday-cell {
        padding: 10px 4px;
        font-size: 9px;
    }

    .calendar-grid-month,
    .calendar-grid-week {
        gap: 8px;
        padding: 8px;
    }

    .calendar-grid-month .calendar-day-card,
    .calendar-grid-week .calendar-day-card,
    .calendar-grid-day .calendar-day-card {
        min-height: 120px;
    }

    .calendar-grid-month .calendar-day-card {
        min-height: 92px;
    }

    .calendar-body-shell.is-month-view #calendar-grid-scroll-region {
        overflow: auto;
    }

    .calendar-body-shell.is-month-view .calendar-grid-month {
        height: auto;
        grid-template-rows: none;
    }
}

/* --- Calendar Event Pills --- */
.calendar-event-pill {
    width: 100%;
    text-align: left;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    transition: all 0.2s ease;
}

.calendar-event-pill:hover {
    transform: translateY(-1px);
}

.calendar-event-time {
    display: block;
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 2px;
    font-weight: 700;
}

.calendar-event-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-empty-label {
    margin-top: auto;
    font-size: 11px;
    color: #c4c7cf;
}

.calendar-more-events {
    font-size: 10px;
    font-weight: 700;
    color: #d81f26;
    margin-top: 2px;
}

/* --- Calendar Day Cell (Alternate) --- */
.calendar-day-cell {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.calendar-day-cell:hover {
    border-color: #fecaca;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.calendar-day-cell.is-other-month {
    background: #f8fafc;
    opacity: 0.72;
}

.calendar-day-cell.is-today {
    border-color: #fca5a5;
    box-shadow: 0 0 0 1px #fecaca inset;
    background: linear-gradient(to bottom, #fffefe, #fff7f7);
}

.calendar-day-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.calendar-day-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}

.calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.calendar-empty-state {
    margin-top: auto;
    font-size: 11px;
    color: #c0c4cc;
}

.calendar-more-link {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #d81f26;
    cursor: pointer;
}

.calendar-view-week,
.calendar-view-day {
    display: grid;
    gap: 12px;
}

.calendar-week-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1024px) {
    .calendar-week-row {
        gap: 8px;
    }

    .calendar-day-cell {
        min-height: 130px;
        padding: 8px;
    }
}
