/* Elementor ICS Calendar Widget Styles */

.ics-calendar-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ics-calendar-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.ics-calendar-container {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Navigation */
.ics-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    gap: 20px;
}

.ics-calendar-nav button {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1;
}

.ics-calendar-nav button:hover {
    background: #145091;
    color: #fff;
    border-color: #145091;
}

.ics-calendar-prev,
.ics-calendar-next {
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ics-calendar-arrow {
    font-size: 18px;
    font-weight: bold;
}

.ics-calendar-current-month {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: center;
    margin: 0 15px;
}

.ics-calendar-today-btn {
    background: #145091 !important;
    color: #fff !important;
    border-color: #145091 !important;
    font-weight: 500;
}

.ics-calendar-today-btn:hover {
    background: #3367d6 !important;
    border-color: #3367d6 !important;
}

/* Loading and Error States */
.ics-calendar-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ics-calendar-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #145091;
    border-radius: 50%;
    animation: ics-calendar-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes ics-calendar-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ics-calendar-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
    line-height: 1.5;
}

.ics-calendar-error-message strong {
    color: #721c24;
    font-weight: 600;
}

.ics-calendar-debug-info {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 20px;
    border: 1px solid #ffeaa7;
    font-size: 12px;
    font-family: monospace;
    white-space: pre-wrap;
    display: none;
}

.ics-calendar-help-text {
    background: #e7f3ff;
    color: #1565c0;
    padding: 12px;
    border-radius: 4px;
    margin: 20px;
    border-left: 4px solid #145091;
    font-size: 13px;
    line-height: 1.4;
}

.ics-calendar-help-text h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.ics-calendar-help-text ol {
    margin: 8px 0;
    padding-left: 16px;
}

.ics-calendar-help-text a {
    color: #1976d2;
    text-decoration: none;
}

.ics-calendar-help-text a:hover {
    text-decoration: underline;
}

.ics-calendar-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #f5c6cb;
    font-size: 14px;
    line-height: 1.5;
}

.ics-calendar-validation-error {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin: 20px;
    border: 1px solid #ffeaa7;
    font-size: 14px;
    line-height: 1.5;
}

/* Desktop Calendar View */
.ics-calendar-desktop-view {
    display: block;
}

.ics-calendar-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.ics-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.ics-calendar-weekday {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #e0e0e0;
}

.ics-calendar-weekday:last-child {
    border-right: none;
}

.ics-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(120px, auto);
}

.ics-calendar-cell {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-left: none;
    padding: 8px;
    min-height: 120px;
    position: relative;
    background: #fff;
    overflow: hidden;
}

.ics-calendar-cell:first-child,
.ics-calendar-cell:nth-child(7n+1) {
    border-left: 1px solid #e0e0e0;
}

.ics-calendar-cell:nth-child(-n+7) {
    border-top: 1px solid #e0e0e0;
}

.ics-calendar-cell.other-month {
    background: #f8f9fa;
    color: #ccc;
}

.ics-calendar-cell.today {
    background: #e3f2fd;
}

.ics-calendar-cell.has-events {
    cursor: pointer;
}

.ics-calendar-date {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.ics-calendar-cell.other-month .ics-calendar-date {
    color: #ccc;
}

.ics-calendar-cell.today .ics-calendar-date {
    color: #1976d2;
    font-weight: 600;
}

/* Events */
.ics-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ics-calendar-event {
    background: #145091;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    position: relative;
}

.ics-calendar-event:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ics-calendar-event.all-day {
    background: #34a853;
}

.ics-calendar-event.all-day:hover {
    background: #2e7d32;
}

.ics-calendar-event-time {
    font-weight: 500;
    margin-right: 4px;
}

.ics-calendar-event-title {
    font-weight: 400;
}

/* More Events Indicator */
.ics-calendar-more-events {
    background: #f5f5f5;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    text-align: center;
    cursor: pointer;
    margin-top: 2px;
}

.ics-calendar-more-events:hover {
    background: #e0e0e0;
}

/* Mobile List View */
.ics-calendar-mobile-view {
    display: none;
    padding: 20px;
}

.ics-calendar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ics-calendar-list-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ics-calendar-list-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #145091;
}

.ics-calendar-list-date {
    color: #145091;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.ics-calendar-list-time {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.ics-calendar-list-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
}

.ics-calendar-list-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.ics-calendar-list-location {
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.ics-calendar-list-location:before {
    content: "📍 ";
    margin-right: 2px;
}

/* Tooltip */
.ics-calendar-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.ics-calendar-tooltip:before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.ics-calendar-tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.ics-calendar-tooltip-time {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 6px;
}

.ics-calendar-tooltip-description {
    margin-bottom: 6px;
    line-height: 1.3;
}

.ics-calendar-tooltip-location {
    color: #ccc;
    font-size: 12px;
    font-style: italic;
}

.ics-calendar-tooltip-location:before {
    content: "📍 ";
    margin-right: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ics-calendar-desktop-view {
        display: none !important;
    }

    .ics-calendar-mobile-view {
        display: block !important;
    }

    .ics-calendar-nav {
        padding: 10px 15px;
    }

    .ics-calendar-nav button {
        padding: 6px 10px;
        font-size: 13px;
    }

    .ics-calendar-current-month {
        font-size: 16px;
        margin: 0 10px;
    }

    .ics-calendar-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .ics-calendar-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ics-calendar-current-month {
        width: 100%;
        order: -1;
        margin: 0 0 10px 0;
    }

    .ics-calendar-today-btn {
        margin-left: auto;
    }

    .ics-calendar-mobile-view {
        padding: 15px;
    }

    .ics-calendar-list-item {
        padding: 12px;
    }
}

/* Large Desktop View */
@media (min-width: 1200px) {
    .ics-calendar-grid {
        grid-auto-rows: minmax(140px, auto);
    }

    .ics-calendar-cell {
        min-height: 140px;
        padding: 10px;
    }

    .ics-calendar-event {
        font-size: 12px;
        padding: 3px 7px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .ics-calendar-container {
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    }

    .ics-calendar-event {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
}

/* Animation for view transitions */
.ics-calendar-desktop-view,
.ics-calendar-mobile-view {
    transition: opacity 0.3s ease;
}

/* Focus states for accessibility */
.ics-calendar-nav button:focus,
.ics-calendar-event:focus,
.ics-calendar-list-item:focus {
    outline: 2px solid #145091;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .ics-calendar-nav {
        display: none;
    }

    .ics-calendar-tooltip {
        display: none;
    }

    .ics-calendar-container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .ics-calendar-event {
        background: #000 !important;
        color: #fff !important;
    }
}
