/* ═══════════════════════════════════════════════════════════════════════════
   FIREASSISTIQ SCHEDULER - DAY & MONTH VIEW CSS FIX
   Add this to the <style> section in app.html
   ═══════════════════════════════════════════════════════════════════════════ */

/* DAY VIEW - Hourly Timeline Grid */
.calendar-grid.day-view {
    display: grid;
    grid-template-columns: 80px repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: auto;
    max-height: calc(100vh - 300px);
}

.grid-corner-day {
    grid-column: 1;
    grid-row: 1;
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 10;
}

.grid-day-tech-header {
    grid-row: 1;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.tech-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.tech-avatar-small img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.tech-name-small {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.grid-hour-label {
    grid-column: 1;
    background: #fafafa;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 12px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-align: right;
    position: sticky;
    left: 0;
    z-index: 3;
}

.grid-hour-cell {
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 4px;
    min-height: 60px;
    position: relative;
    background: white;
    transition: background 0.2s;
}

.grid-hour-cell:hover {
    background: #f8f9fa;
}

.grid-hour-cell.drop-hover {
    background: #e3f2fd !important;
    border: 2px dashed #2196F3 !important;
}

.job-card-compact {
    background: white;
    border-left: 3px solid #2196F3;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.job-card-compact:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.job-card-compact.status-completed {
    opacity: 0.7;
    border-left-color: #4CAF50;
}

.job-card-compact.status-in-progress {
    border-left-color: #FF9800;
}

.job-card-compact.status-urgent {
    border-left-color: #F44336;
}

.job-time-compact {
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

.job-site-compact {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
}

.job-type-compact {
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.add-job-btn-tiny {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    background: #E53935;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
}

.grid-hour-cell:hover .add-job-btn-tiny {
    display: flex;
}

.add-job-btn-tiny:hover {
    background: #C62828;
    transform: scale(1.1);
}

/* MONTH VIEW - Calendar Grid */
.calendar-grid.month-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.month-day-header {
    background: #f5f5f5;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.month-day-cell {
    background: white;
    padding: 8px;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.month-day-cell:hover {
    background: #f8f9fa;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1;
}

.month-day-cell.empty {
    background: #fafafa;
    cursor: default;
}

.month-day-cell.today {
    background: #e3f2fd;
    border: 2px solid #2196F3;
}

.month-day-cell.other-month {
    background: #fafafa;
    opacity: 0.6;
}

.month-day-cell.other-month .month-day-number {
    color: #999;
}

.month-day-cell.drop-hover {
    background: #fff3e0 !important;
    border: 2px dashed #FF9800 !important;
}

.month-day-number {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.month-day-cell.today .month-day-number {
    color: #2196F3;
}

.month-day-jobs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
}

.month-job-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.month-job-dot:hover {
    transform: scale(1.5);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.month-job-more {
    font-size: 10px;
    color: #666;
    font-weight: 600;
    padding: 2px 4px;
    background: #f0f0f0;
    border-radius: 3px;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 1400px) {
    .calendar-grid.day-view {
        grid-template-columns: 70px repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .month-day-cell {
        min-height: 80px;
        padding: 6px;
    }
    
    .month-day-number {
        font-size: 16px;
    }
}

@media (max-width: 1024px) {
    .calendar-grid.day-view {
        grid-template-columns: 60px repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .tech-name-small {
        display: none;
    }
    
    .month-day-cell {
        min-height: 60px;
        padding: 4px;
    }
    
    .month-day-number {
        font-size: 14px;
    }
}

/* DRAG & DROP STATES */
.grid-hour-cell.drop-target,
.month-day-cell.drop-target {
    position: relative;
}

.grid-hour-cell.drop-target::after,
.month-day-cell.drop-target::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed transparent;
    pointer-events: none;
    border-radius: 4px;
}

/* WEEK VIEW - Keep existing styles, just ensure it works */
.calendar-grid.week-view {
    display: grid;
    grid-template-columns: 200px repeat(7, 1fr);
    gap: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: auto;
}

/* Ensure grid doesn't break */
.calendar-grid > * {
    box-sizing: border-box;
}
