/* Hide month view button for single calendars */
.cgc-calendar-container:not(.cgc-multi-calendar) .cgc-view-btn[data-view="month"] {
    display: none;
}

/* Center the list button when month button is hidden */
.cgc-calendar-container:not(.cgc-multi-calendar) .cgc-view-controls {
    justify-content: center;
}

.cgc-calendar-container:not(.cgc-multi-calendar) .cgc-view-btn[data-view="list"] {
    border-radius: 6px; /* Make it fully rounded when alone */
}/* Custom Google Calendar Plugin Styles */

.cgc-calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: inherit;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Calendar Header */
.cgc-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.cgc-nav-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cgc-nav-btn, .cgc-today-btn {
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #24292f;
    transition: all 0.2s ease;
}

.cgc-nav-btn:hover, .cgc-today-btn:hover {
    background: #f3f4f6;
    border-color: #8b949e;
}

.cgc-date-range {
    font-size: 18px;
    font-weight: 600;
    color: #24292f;
}

.cgc-view-controls {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
}

.cgc-view-btn {
    background: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #656d76;
    transition: all 0.2s ease;
    border-right: 1px solid #d0d7de;
}

.cgc-view-btn:last-child {
    border-right: none;
}

.cgc-view-btn.active {
    background: #24292f;
    color: #fff;
}

.cgc-view-btn:not(.active):hover {
    background: #f3f4f6;
}

/* Calendar Content */
.cgc-calendar-content {
    min-height: 400px;
    position: relative;
}

.cgc-loading {
    text-align: center;
    padding: 40px;
    color: #656d76;
    font-size: 16px;
}

/* List View - Updated to match your image */
.cgc-list-view {
    padding: 0;
}

.cgc-day-section {
    /* Remove borders for cleaner look */
}

.cgc-day-header {
    background: #e8f4fd;
    padding: 8px 16px;
    font-weight: 600;
    color: #3c4859;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #d1e7dd;
}

.cgc-day-header.past {
    background: #f8f9fa;
    color: #6b7280;
}

.cgc-event-list {
    padding: 0;
    margin: 0;
    list-style: none;
    background: #fff;
}

.cgc-event-item {
    display: flex;
    align-items: center;
    padding: 2px 5px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cgc-event-item:hover {
    background: #f8fafc;
}

.cgc-event-item:last-child {
    border-bottom: none;
}

.cgc-event-item.past {
    opacity: 0.6;
}

.cgc-event-time {
    min-width: 140px;
    font-size: 16px;
    color: #4b5563;
    font-weight: 500;
    margin-right: 15px;
}

.cgc-event-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    margin-right: 15px;
    flex-shrink: 0;
}

.cgc-event-title {
    color: #313131;
    font-size: 16px;
    text-decoration: none;
    flex: 1;
    font-weight: 500;
}

.cgc-event-title:hover {
    text-decoration: none;
    color: #3b82f6;
}

/* Month View */
.cgc-month-view {
    display: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cgc-month-view.active {
    display: block;
}

.cgc-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: 700px; /* Minimum width to prevent crushing on mobile */
}

.cgc-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f6f8fa;
    border-bottom: 1px solid #e0e0e0;
    min-width: 700px; /* Match grid width */
}

.cgc-day-name {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #656d76;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cgc-month-day {
    min-height: 120px;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px;
    position: relative;
    background: #fff;
    min-width: 100px; /* Ensure minimum width for each day cell */
}

.cgc-month-day:nth-child(7n) {
    border-right: none;
}

.cgc-month-day.other-month {
    background: #f6f8fa;
    color: #8b949e;
}

.cgc-month-day.past {
    background: #f9f9f9;
}

.cgc-day-number {
    font-size: 14px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 4px;
}

.cgc-month-day.other-month .cgc-day-number {
    color: #8b949e;
}

.cgc-month-event {
    background: #ddf4ff;
    color: #0969da;
    font-size: 11px;
    padding: 2px 6px;
    margin: 1px 0;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.cgc-month-event:hover {
    background: #b6e3ff;
}

.cgc-month-event.past {
    opacity: 0.6;
}

/* Modal */
.cgc-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cgc-modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.cgc-close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #8b949e;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cgc-close:hover {
    color: #24292f;
    background: #f3f4f6;
}

.cgc-modal-body {
    padding: 30px;
}

.cgc-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #24292f;
    margin: 0 0 15px 0;
    padding-right: 40px;
}

.cgc-modal-time {
    color: #0969da;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 500;
}

.cgc-modal-description {
    color: #656d76;
    line-height: 1.6;
    margin-bottom: 15px;
}

.cgc-modal-description a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.cgc-modal-description a:hover {
    color: #1d4ed8;
    border-bottom-color: #3b82f6;
}

.cgc-modal-location {
    color: #656d76;
    font-size: 14px;
}

.cgc-modal-location::before {
    content: "📍 ";
    margin-right: 5px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cgc-calendar-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .cgc-nav-controls {
        justify-content: center;
    }
    
    .cgc-date-range {
        text-align: center;
    }
    
    .cgc-view-controls {
        align-self: center;
    }
    
    /* Force horizontal layout for mobile */
    .cgc-event-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 8px 8px !important; /* Reduced left/right padding from 12px to 8px */
        gap: 0 !important;
    }
    
    .cgc-event-time {
        min-width: 130px !important;
        font-size: 16px !important; /* Increased from 14px to 16px */
        margin-right: 12px !important;
        flex-shrink: 0 !important;
        width: auto !important;
    }
    
    .cgc-event-indicator {
        margin-right: 12px !important;
        margin-left: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .cgc-event-title {
        font-size: 16px !important; /* Increased from 14px to 16px */
        flex: 1 !important;
        margin: 0 !important;
    }
    
    /* Month view mobile adjustments */
    .cgc-month-view {
        padding-bottom: 20px; /* Add bottom padding for scroll space */
    }
    
    .cgc-month-grid {
        min-width: 700px; /* Ensure it's wide enough to scroll */
    }
    
    .cgc-month-header {
        min-width: 700px;
    }
    
    .cgc-month-day {
        min-height: 80px !important;
        padding: 4px !important;
        min-width: 100px;
    }
    
    .cgc-day-name {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .cgc-month-event {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .cgc-modal-content {
        width: 95%;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .cgc-event-item {
        padding: 6px 6px !important; /* Reduced from 8px to 6px */
    }
    
    .cgc-event-time {
        min-width: 110px !important;
        font-size: 15px !important; /* Increased from 13px to 15px */
        margin-right: 10px !important;
    }
    
    .cgc-event-title {
        font-size: 15px !important; /* Increased from 13px to 15px */
    }
    
    .cgc-event-indicator {
        width: 6px !important;
        height: 6px !important;
        margin-right: 10px !important;
    }
    
    /* Month view for very small screens */
    .cgc-month-grid {
        min-width: 600px; /* Slightly smaller for phones */
    }
    
    .cgc-month-header {
        min-width: 600px;
    }
    
    .cgc-month-day {
        min-height: 70px !important;
        min-width: 85px;
    }
    
    .cgc-day-name {
        padding: 6px 2px;
        font-size: 10px;
    }
    
    .cgc-month-event {
        font-size: 9px;
        padding: 1px 3px;
    }
}

/* Error States */
.cgc-error {
    text-align: center;
    padding: 40px;
    color: #cf222e;
    font-size: 16px;
}

.cgc-no-events {
    text-align: center;
    padding: 40px;
    color: #656d76;
    font-size: 16px;
    font-style: italic;
}
