/* WP Google Calendar Events - Frontend Styles */

.wpgce-calendar {
    font-family: inherit;
    position: relative;
    margin-block-end: 1rem;
}

/* Error and No Events Messages */
.wpgce-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

.wpgce-no-events {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px 16px;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
}

/* Event Item Base Styles */
.wpgce-event-item {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wpgce-event-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* .wpgce-event-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #0f75bf, #00427b);
} */

/* Event Header */
.wpgce-event-header {
    margin-bottom: 12px;
}

.wpgce-event-title {
    margin: 0 0 8px 0;
    font-size: 1em;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.wpgce-event-title a {
    color: #0f75bf;
    text-decoration: none;
    transition: color 0.2s ease;
}

.wpgce-event-title a:hover {
    color: #00427b;
}

/* Event Meta Information */
.wpgce-event-meta {
    /* margin-bottom: 16px; */
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.wpgce-event-date {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpgce-event-date::before {
    /* content: '📅';
    font-size: 1.1em; */
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9Ii0zMiAwIDUxMiA1M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LjQtMTIgMTItMTJoNDBjNi42IDAgMTIgNS40IDEyIDEydjUyaDQ4YzI2LjUgMCA0OCAyMS41IDQ4IDQ4Wm0tNDggMzQ2VjE2MEg0OHYyOThjMCAzLjMgMi43IDYgNiA2aDM0MGMzLjMgMCA2LTIuNyA2LTZaIi8+Cjwvc3ZnPgo=);
    background-size: cover;
    background-position: center;
}

.wpgce-date {
    font-weight: 600;
    color: #333;
}

.wpgce-time {
    color: #666;
    font-weight: 500;
}

.wpgce-event-location {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* .wpgce-event-location::before {
    content: '📍';
    font-size: 1.1em;
} */

/* Event Description */
.wpgce-event-description {
    color: #555;
    line-height: 1.6;
    font-size: 0.95em;
}

/* List View Styles */
.wpgce-list-view {
    display: flex;
    flex-direction: column;
}

.wpgce-view-list .wpgce-event-item {
    display: flex;
    flex-direction: column;
}

/* Grid View Styles */
.wpgce-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.wpgce-grid-item {
    height: 100%;
}

.wpgce-grid-item .wpgce-event-item {
    height: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.wpgce-grid-item .wpgce-event-description {
    flex-grow: 1;
}

/* Month View Styles */
.wpgce-month-view {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wpgce-month-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.wpgce-month-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin: 0;
}

.wpgce-month-events {
    padding: 20px;
}

.wpgce-month-view .wpgce-event-item {
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0;
    margin-bottom: 0;
    border-bottom: 1px solid #f1f3f4;
    padding: 16px 0;
}

.wpgce-month-view .wpgce-event-item:last-child {
    border-bottom: none;
}

.wpgce-month-view .wpgce-event-item::before {
    display: none;
}

/* Loading State */
.wpgce-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wpgce-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4285f4;
    border-radius: 50%;
    animation: wpgce-spin 1s linear infinite;
    z-index: 10;
}

@keyframes wpgce-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Navigation Buttons (for future use) */
.wpgce-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wpgce-nav-button {
    background: #4285f4;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wpgce-nav-button:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.wpgce-nav-button:active {
    transform: translateY(0);
}

.wpgce-nav-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* View Toggle Buttons */
.wpgce-view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #f1f3f4;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.wpgce-view-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    transition: all 0.2s ease;
}

.wpgce-view-btn.active,
.wpgce-view-btn:hover {
    background: #fff;
    color: #1a73e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpgce-grid-view {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wpgce-event-item {
        padding: 16px;
        margin-bottom: 12px;
    }

    .wpgce-event-title {
        font-size: 1.15em;
    }

    .wpgce-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .wpgce-nav-button {
        width: 100%;
        justify-content: center;
    }

    .wpgce-view-toggle {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wpgce-calendar {
        margin: 16px 0;
    }

    .wpgce-event-item {
        padding: 12px;
        border-radius: 6px;
    }

    .wpgce-event-title {
        font-size: 1.1em;
    }

    .wpgce-event-meta {
        font-size: 0.85em;
    }

    .wpgce-event-date,
    .wpgce-event-location {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .wpgce-month-header,
    .wpgce-month-events {
        padding: 16px;
    }

    .wpgce-month-title {
        font-size: 1.2em;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wpgce-event-item {
        border: 2px solid #000;
    }

    .wpgce-event-title a {
        color: #0000ee;
    }

    .wpgce-nav-button {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .wpgce-event-item,
    .wpgce-nav-button,
    .wpgce-view-btn {
        transition: none;
    }

    .wpgce-event-item:hover {
        transform: none;
    }

    @keyframes wpgce-spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wpgce-event-item {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .wpgce-event-title {
        color: #f7fafc;
    }

    .wpgce-event-title a {
        color: #63b3ed;
    }

    .wpgce-event-meta {
        color: #a0aec0;
    }

    .wpgce-event-description {
        color: #cbd5e0;
    }

    .wpgce-month-view {
        background: #2d3748;
        border-color: #4a5568;
    }

    .wpgce-month-header {
        background: #1a202c;
        border-color: #4a5568;
    }

    .wpgce-month-title {
        color: #f7fafc;
    }
}

/* Print Styles */
@media print {
    .wpgce-calendar {
        margin: 0;
    }

    .wpgce-event-item {
        box-shadow: none;
        border: 1px solid #000;
        margin-bottom: 10px;
        break-inside: avoid;
    }

    .wpgce-event-item:hover {
        transform: none;
        box-shadow: none;
    }

    .wpgce-navigation,
    .wpgce-view-toggle {
        display: none;
    }

    .wpgce-event-title a {
        color: #000;
        text-decoration: underline;
    }
}