/* Dashboard Widgets Styles */

.widget-wrapper {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.widget-wrapper.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.widget-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    overflow: hidden;
}

.widget-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.widget-drag-handle {
    cursor: move;
    color: var(--text-muted);
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.widget-drag-handle:hover {
    opacity: 1;
}

.widget-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.widget-actions {
    display: flex;
    gap: 0.25rem;
}

.widget-remove {
    padding: 0.25rem 0.5rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.widget-remove:hover {
    color: #dc3545;
}

.widget-body {
    padding: 1.25rem;
    background: white;
}

.widget-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

/* Stats Widget */
.stat-item {
    text-align: center;
    padding: 1rem 0.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Appointments Widget */
.appointment-widget-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: background 0.2s ease;
}

.appointment-widget-item:hover {
    background: #e9ecef;
}

.appointment-widget-item:last-child {
    margin-bottom: 0;
}

.appointment-date {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 8px;
}

.date-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.date-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 0.125rem;
}

.appointment-details {
    flex: 1;
    min-width: 0;
}

.appointment-service {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.appointment-time,
.appointment-location {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.appointment-status {
    flex-shrink: 0;
}

/* Quick Actions Widget */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: var(--primary);
}

.quick-action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-action-btn:hover i {
    color: white;
}

/* Recommendations Widget */
.recommendation-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%);
}

.recommendation-item:last-child {
    margin-bottom: 0;
}

.recommendation-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendation-content {
    flex: 1;
}

.recommendation-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.recommendation-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.recommendation-priority {
    display: inline-block;
}

.badge-high {
    background: #dc3545;
}

.badge-medium {
    background: #ffc107;
}

.badge-low {
    background: #6c757d;
}

/* Recent Activity Widget */
.activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: #e9ecef;
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.activity-completed {
    background: #10b981;
}

.activity-scheduled {
    background: #3b82f6;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

.activity-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Service Status Widget */
.service-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-label {
    font-weight: 500;
    color: var(--text-dark);
}

.status-count {
    font-weight: 600;
}

/* Widget Customization Panel */
.widget-customization-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
}

.widget-customization-panel.open {
    right: 0;
}

.customization-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customization-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.close-customization {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.close-customization:hover {
    background: rgba(255, 255, 255, 0.2);
}

.customization-body {
    padding: 1.5rem;
}

.widget-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.widget-option:hover {
    border-color: var(--primary);
    background: #f8f9fa;
}

.widget-option-info {
    flex: 1;
}

.widget-option-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.widget-option-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.widget-toggle {
    position: relative;
    width: 48px;
    height: 24px;
}

.widget-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.widget-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.widget-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.widget-toggle input:checked + .widget-toggle-slider {
    background-color: var(--primary);
}

.widget-toggle input:checked + .widget-toggle-slider:before {
    transform: translateX(24px);
}

/* Customize Button */
.customize-widgets-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

.customize-widgets-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 991px) {
    .widget-customization-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 576px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 0.75rem 0.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}
