/* Widget Scrollbars and Spacing - Future-ready widget support */

/* Enhanced Custom Scrollbars for All Browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Firefox scrollbar support */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.dark * {
    scrollbar-color: #6b7280 #374151;
}

/* Widget Container Base Classes */
.widget-container {
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dark .widget-container {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

/* Scrollable Widget Areas */
.widget-scrollable {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.widget-scrollable-large {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

.widget-scrollable-small {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

/* Horizontal Scrollable Areas */
.widget-horizontal-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 0.5rem;
}

/* Widget Spacing Utilities */
.widget-spacing-sm {
    margin: 0.5rem 0;
    padding: 1rem;
}

.widget-spacing-md {
    margin: 1rem 0;
    padding: 1.5rem;
}

.widget-spacing-lg {
    margin: 1.5rem 0;
    padding: 2rem;
}

.widget-spacing-xl {
    margin: 2rem 0;
    padding: 2.5rem;
}

/* Grid spacing for widget layouts */
.widgets-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.widgets-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.widgets-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.widgets-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Responsive spacing adjustments */
@media (max-width: 768px) {
    .widget-container {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .widgets-grid {
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .widget-spacing-lg,
    .widget-spacing-xl {
        padding: 1.5rem;
        margin: 1rem 0;
    }
}

/* Future widget support - common patterns */
.widget-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.dark .widget-header {
    border-bottom-color: #374151;
}

.widget-content {
    line-height: 1.6;
}

.widget-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.dark .widget-footer {
    border-top-color: #374151;
}

/* Loading and empty states for widgets */
.widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: #6b7280;
}

.widget-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

/* Hover effects for interactive widgets */
.widget-interactive:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.dark .widget-interactive:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}