/* Zoho Bookings Widget Styles */

.zoho-bookings-widget-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.zoho-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    background: #ffffff;
    border-bottom: 0px solid #e5e7eb;
}

.zoho-widget-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    display:none;
}

.zoho-widget-controls {
    display: flex;
    gap: 0px;
}

.zoho-refresh-btn {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.zoho-refresh-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.zoho-refresh-btn:active {
    transform: rotate(180deg);
}

.zoho-debug-btn {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    display:none;
}

.zoho-debug-btn:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}

.zoho-widget-body {
    padding: 20px;
    position: relative;
    min-height: 400px;
}

/* Loading State */
.zoho-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.zoho-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

.zoho-loading p {
    margin-top: 20px;
    color: #6b7280;
    font-size: 16px;
}

/* Error State */
.zoho-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-message {
    color: #dc2626;
    font-size: 16px;
    max-width: 500px;
}

/* Chart Container */
.zoho-chart-container {
    margin: 0;
}

/* Widget Footer */
.zoho-widget-footer {
    border-top: 1px solid #e5e7eb;
    padding: 10px;
    background: #f9fafb;
}

.zoho-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 00px;
    margin-bottom: 5px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.stat-value.positive {
    color: #059669;
}

.stat-value.negative {
    color: #dc2626;
}

.stat-value.neutral {
    color: #6b7280;
}

.zoho-last-updated {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

.update-time {
    font-weight: 500;
    color: #6b7280;
}

/* Metadata Section */
.zoho-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
}

.metadata-item {
    display: flex;
    gap: 5px;
    align-items: center;
}

.metadata-label {
    color: #9ca3af;
}

.metadata-value {
    font-weight: 600;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .zoho-widget-header {
        flex-direction: column;
        gap: 0px;
        align-items: flex-start;
    }
    
    .zoho-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .zoho-metadata {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .zoho-bookings-widget-container {
        background: #1f2937;
        border-color: #374151;
    }
    
    .zoho-widget-header,
    .zoho-widget-footer {
        background: #ffffff;
    }
    
    .zoho-widget-title {
        color: #f9fafb;
    }
    
    .zoho-refresh-btn {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .zoho-refresh-btn:hover {
        background: #4b5563;
        border-color: #6b7280;
        color: #f3f4f6;
    }
    
    .zoho-loading p,
    .stat-label,
    .metadata-label,
    .update-time {
        color: #9ca3af;
    }
    
    .stat-value,
    .metadata-value {
        color: #f9fafb;
    }
    
    .zoho-spinner {
        border-color: #374151;
        border-top-color: #3b82f6;
    }
}
