/* Google Calendar Grid Styles */

.google-calendar-grid {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border-bottom: 1px solid #e0e0e0;
}

.calendar-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    text-align: center;
    flex-grow: 1;
}

.calendar-nav {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
}

/* Calendar Grid */
.calendar-grid {
    display: flex;
    flex-direction: column;
}

.calendar-week {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.calendar-week:last-child {
    border-bottom: none;
}

.calendar-week-header {
    background: #f8f9fa;
    font-weight: 600;
    color: #5f6368;
}

.calendar-day {
    flex: 1;
    min-height: 120px;
    padding: 8px;
    border-right: 1px solid #e0e0e0;
    position: relative;
    background: #fff;
    transition: background-color 0.2s ease;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day-header {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day.other-month {
    background: #fafafa;
    color: #9aa0a6;
}

.calendar-day.today {
    background: #e8f0fe;
}

.calendar-day.today .day-number {
    background: #4285f4;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.day-number {
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    margin-bottom: 8px;
}

/* Event Bullets */
.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    margin: 1px 0;
    transition: transform 0.2s ease;
}

.event-bullet:hover {
    transform: scale(1.2);
}

/* Event Popover */
.event-popover {
    position: absolute;
    top: -10px;
    left: 15px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 250px;
    max-width: 300px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.event-bullet:hover .event-popover {
    opacity: 1;
    visibility: visible;
}

.popover-content {
    padding: 16px;
}

.popover-content h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    line-height: 1.3;
}

.popover-content p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #5f6368;
}

.popover-content p strong {
    color: #202124;
    font-weight: 500;
}

/* Popover Arrow */
.event-popover::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -6px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #dadce0;
}

.event-popover::after {
    content: '';
    position: absolute;
    top: 8px;
    left: -5px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid white;
}

/* Pill-shaped event label */
.google-calendar-grid .calendar-event-pill {
    display: block;
    width: 100%;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 4px;
    margin-right: 0;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: filter 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    position: relative;
    min-height: 24px;
    line-height: 16px;
    vertical-align: middle;
}

.google-calendar-grid .calendar-event-pill:hover {
    filter: brightness(0.92);
    z-index: 2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .google-calendar-grid {
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .calendar-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-title {
        font-size: 20px;
        order: 2;
    }
    
    .calendar-nav {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-day-header {
        min-height: 30px;
        font-size: 12px;
    }
    
    .day-number {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .event-bullet {
        width: 6px;
        height: 6px;
    }
    
    .event-popover {
        min-width: 200px;
        max-width: 250px;
        left: 10px;
    }
    
    .popover-content {
        padding: 12px;
    }
    
    .popover-content h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .popover-content p {
        font-size: 12px;
        margin: 6px 0;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 60px;
        padding: 2px;
    }
    
    .day-number {
        font-size: 11px;
    }
    
    .event-bullet {
        width: 5px;
        height: 5px;
    }
    
    .event-popover {
        min-width: 180px;
        left: 8px;
    }
}

/* Loading State */
.google-calendar-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.google-calendar-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #4285f4;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 