﻿/* ========================================
   DAY ACTION MENU - FLOATING GLASS MENU
   ======================================== */

.day-action-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
    cursor: default;
}

.day-action-menu {
    position: fixed;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--frost-blur);
    border: 1px solid var(--frost-border);
    box-shadow: 0 10px 30px var(--frost-shadow), inset 0 0 25px rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    overflow: hidden;
    min-width: 200px;
    animation: slideInScale 0.2s ease-out;
}

html.dark .day-action-menu {
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: var(--frost-blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.day-action-menu-content {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.day-action-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #1a1a1a;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

html.dark .day-action-menu-item {
    color: #f5f5f7;
}

.day-action-menu-item:hover {
    background: rgba(0, 0, 0, 0.08);
}

.day-action-menu-item:active {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(0.98);
}

html.dark .day-action-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

html.dark .day-action-menu-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.day-action-menu-item span {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

/* Animation */
@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   CALENDAR DAY CELL WITH TECHNICIAN BADGE
   ======================================== */

.calendar-day {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: rgba(79, 70, 229, 0.08);
}

.calendar-month-cell.calendar-day:hover,
.calendar-column.calendar-day:hover {
    background: #e0e0e0;
}

/* Technician color badge - diagonal triangle in top-right corner
   Applied to the day label (button or div) */
.calendar-day.has-after-hours {
    overflow: visible !important;
}

/* Badge triangle on the label using ::after pseudo-element */
.calendar-day.has-after-hours .calendar-day-label::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 0;
    height: 0;
    border-left: 36px solid transparent;
    border-top: 36px solid var(--tech-color, #4F46E5);
    border-radius: 0 20px 0 0;
    pointer-events: auto;
    z-index: 20;
}

/* Shine/bevel effect on the badge using ::before pseudo-element */
.calendar-day.has-after-hours .calendar-day-label::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.15) 40%,
        rgba(255, 255, 255, 0) 100%);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    pointer-events: none;
    z-index: 21;
    border-radius: 0 20px 0 0;
}

/* Brighten badge on hover */
.calendar-day.has-after-hours .calendar-day-label:hover::after {
    filter: brightness(1.2);
}

/* Position the calendar-day-label correctly for badge */
.calendar-day-label {
    position: relative;
}

/* Style label when it has tooltip */
.calendar-day-label[title] {
    cursor: help;
}

/* Dark mode adjustments */
html.dark .calendar-day:hover {
    background: rgba(79, 70, 229, 0.15);
}

html.dark .calendar-month-cell.calendar-day:hover,
html.dark .calendar-column.calendar-day:hover {
    background: #2c2c2e;
}

html.dark .calendar-day.has-after-hours .calendar-day-label::before {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.1) 40%,
        rgba(255, 255, 255, 0) 100%);
}

/* Fix overflow for week view cards with badges */
.apple-card.calendar-day.has-after-hours {
    overflow: visible;
}

/* ========================================
   HOLIDAY DAY CELLS
   ======================================== */

.calendar-day.has-holiday.is-closed {
    background: #ead7db !important;
    box-shadow:
        8px 8px 16px rgba(163, 177, 198, 0.45),
        -8px -8px 16px rgba(255, 255, 255, 0.8);
}

.calendar-day.has-holiday.is-open {
    background: #dce8df !important;
    box-shadow:
        8px 8px 16px rgba(163, 177, 198, 0.45),
        -8px -8px 16px rgba(255, 255, 255, 0.8);
}

.calendar-month-cell.calendar-day.has-holiday.is-closed:hover,
.calendar-column.calendar-day.has-holiday.is-closed:hover {
    background: #ead7db !important;
}

.calendar-month-cell.calendar-day.has-holiday.is-open:hover,
.calendar-column.calendar-day.has-holiday.is-open:hover {
    background: #dce8df !important;
}

.calendar-holiday {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin: 0 0 8px 0;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.calendar-holiday.is-closed {
    background: #ffe4e6;
    color: #9f1239;
}

.calendar-holiday.is-open {
    background: #dcfce7;
    color: #166534;
}

.calendar-holiday-status {
    flex-shrink: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

html.dark .calendar-day.has-holiday.is-closed {
    background: rgba(159, 18, 57, 0.22) !important;
}

html.dark .calendar-day.has-holiday.is-open {
    background: rgba(22, 101, 52, 0.22) !important;
}

.timeline-holiday-banner {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.45),
        -4px -4px 8px rgba(255, 255, 255, 0.85);
}

.timeline-holiday-banner.is-closed {
    background: #ead7db;
    color: #9f1239;
}

.timeline-holiday-banner.is-open {
    background: #dce8df;
    color: #166534;
}
