/**
 * Calendar Widget Styles
 *
 * @package JCA_Zoom_Integration
 * @since 2.0.0
 */

/* Widget Container */
.jca-zoom-calendar-widget {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.jca-zoom-calendar-widget-content {
    padding: 0;
}

/* No Events State */
.jca-zoom-no-events {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Events List */
.jca-zoom-events-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Event Item */
.jca-zoom-event-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
    position: relative;
}

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

.jca-zoom-event-item:hover {
    background-color: #f8fafc;
}

/* Event Status Classes */
.jca-zoom-event-upcoming {
    border-left: 4px solid #3b82f6;
}

.jca-zoom-event-starting-soon {
    border-left: 4px solid #f59e0b;
    background-color: #fffbeb;
}

.jca-zoom-event-live {
    border-left: 4px solid #10b981;
    background-color: #f0fdf4;
    animation: jca-zoom-pulse 2s infinite;
}

.jca-zoom-event-ended {
    border-left: 4px solid #64748b;
    opacity: 0.7;
}

@keyframes jca-zoom-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Event Date */
.jca-zoom-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    margin-right: 15px;
    text-align: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 8px 6px;
    flex-shrink: 0;
}

.jca-zoom-event-day {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: #1e293b;
}

.jca-zoom-event-month {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 2px;
}

.jca-zoom-event-year {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Live event date styling */
.jca-zoom-event-live .jca-zoom-event-date {
    background: #dcfce7;
    color: #166534;
}

.jca-zoom-event-live .jca-zoom-event-day {
    color: #166534;
}

/* Starting soon event date styling */
.jca-zoom-event-starting-soon .jca-zoom-event-date {
    background: #fef3c7;
    color: #92400e;
}

.jca-zoom-event-starting-soon .jca-zoom-event-day {
    color: #92400e;
}

/* Event Details */
.jca-zoom-event-details {
    flex: 1;
    min-width: 0;
}

.jca-zoom-event-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #1e293b;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.jca-zoom-event-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 12px;
    background: #e2e8f0;
    color: #64748b;
}

.jca-zoom-type-webinar {
    background: #dbeafe;
    color: #1e40af;
}

.jca-zoom-type-meeting {
    background: #f3e8ff;
    color: #7c3aed;
}

.jca-zoom-event-time {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    gap: 5px;
}

.jca-zoom-event-time .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.jca-zoom-event-duration {
    color: #94a3b8;
    font-weight: 500;
}

.jca-zoom-event-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* Event Status */
.jca-zoom-event-status {
    margin-bottom: 10px;
}

.jca-zoom-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 12px;
    line-height: 1;
}

.jca-zoom-status-scheduled {
    background: #dbeafe;
    color: #1e40af;
}

.jca-zoom-status-live {
    background: #dcfce7;
    color: #166534;
}

.jca-zoom-status-ended {
    background: #f3f4f6;
    color: #374151;
}

.jca-zoom-status-cancelled {
    background: #fef2f2;
    color: #dc2626;
}

/* Event Actions */
.jca-zoom-event-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jca-zoom-join-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    justify-content: center;
}

.jca-zoom-join-button:hover {
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.jca-zoom-join-button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Join Button States */
.jca-zoom-join-live {
    background: #10b981;
    animation: jca-zoom-button-pulse 2s infinite;
}

.jca-zoom-join-live:hover {
    background: #059669;
}

.jca-zoom-join-ready {
    background: #f59e0b;
}

.jca-zoom-join-ready:hover {
    background: #d97706;
}

.jca-zoom-join-upcoming {
    background: #6b7280;
}

.jca-zoom-join-upcoming:hover {
    background: #4b5563;
}

.jca-zoom-join-ended {
    background: #64748b;
    opacity: 0.7;
}

.jca-zoom-join-ended:hover {
    background: #475569;
}

@keyframes jca-zoom-button-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }
}

/* Event Password */
.jca-zoom-event-password {
    margin-top: 5px;
}

.jca-zoom-event-password small {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 12px;
}

.jca-zoom-event-password .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.jca-zoom-event-password code {
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

/* View All Link */
.jca-zoom-view-all {
    padding: 15px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.jca-zoom-view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.jca-zoom-view-all-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.jca-zoom-view-all-link::after {
    content: "→";
    transition: transform 0.2s ease;
}

.jca-zoom-view-all-link:hover::after {
    transform: translateX(2px);
}

/* Loading State */
.jca-zoom-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #64748b;
}

.jca-zoom-widget-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: jca-zoom-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Error State */
.jca-zoom-widget-error {
    padding: 20px;
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin: 10px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .jca-zoom-event-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .jca-zoom-event-date {
        align-self: flex-start;
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .jca-zoom-event-title {
        font-size: 15px;
    }
    
    .jca-zoom-join-button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Widget in Sidebar */
.widget .jca-zoom-calendar-widget {
    background: transparent;
    box-shadow: none;
}

.widget .jca-zoom-event-item {
    padding: 12px 0;
}

.widget .jca-zoom-event-date {
    min-width: 50px;
    padding: 6px 4px;
}

.widget .jca-zoom-event-day {
    font-size: 18px;
}

.widget .jca-zoom-event-title {
    font-size: 14px;
}

.widget .jca-zoom-event-time {
    font-size: 12px;
}

.widget .jca-zoom-join-button {
    padding: 6px 10px;
    font-size: 12px;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .jca-zoom-calendar-widget {
        background: #1e293b;
        color: #f8fafc;
    }
    
    .jca-zoom-event-item {
        border-bottom-color: #334155;
    }
    
    .jca-zoom-event-item:hover {
        background-color: #334155;
    }
    
    .jca-zoom-event-date {
        background: #334155;
    }
    
    .jca-zoom-event-title {
        color: #f8fafc;
    }
    
    .jca-zoom-event-time,
    .jca-zoom-event-description {
        color: #cbd5e1;
    }
    
    .jca-zoom-event-password code {
        background: #334155;
        color: #f8fafc;
        border-color: #475569;
    }
    
    .jca-zoom-view-all {
        background: #334155;
        border-top-color: #475569;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .jca-zoom-event-item {
        border: 2px solid #000;
        margin-bottom: 5px;
    }
    
    .jca-zoom-join-button {
        border: 2px solid #000;
    }
    
    .jca-zoom-status-badge,
    .jca-zoom-event-type {
        border: 1px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .jca-zoom-join-button:hover {
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    .jca-zoom-event-actions,
    .jca-zoom-view-all {
        display: none;
    }
    
    .jca-zoom-calendar-widget {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .jca-zoom-event-item {
        page-break-inside: avoid;
    }
}
