/* Additional UI Components for Purple Dashboard Theme */

/* Enhanced Card Components */
.card-stats {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease-out;
}

.card-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-purple), var(--primary-purple-light));
}

.card-stats:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-gradient-primary {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
    color: white;
}

.card-gradient-success {
    background: linear-gradient(135deg, var(--success) 0%, #34D399 100%);
    color: white;
}

.card-gradient-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #FBBF24 100%);
    color: white;
}

.card-gradient-info {
    background: linear-gradient(135deg, var(--info) 0%, #60A5FA 100%);
    color: white;
}

.card-gradient-danger {
    background: linear-gradient(135deg, var(--error) 0%, #F87171 100%);
    color: white;
}

/* Enhanced Button Variants */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-light) 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(107, 70, 193, 0.3);
}

.btn-gradient-primary:hover {
    background: linear-gradient(135deg, var(--primary-purple-dark) 0%, var(--primary-purple) 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(107, 70, 193, 0.4);
}

.btn-soft-primary {
    background: rgba(107, 70, 193, 0.1);
    color: var(--primary-purple);
    border: 1px solid rgba(107, 70, 193, 0.2);
}

.btn-soft-primary:hover {
    background: rgba(107, 70, 193, 0.2);
    color: var(--primary-purple-dark);
    border-color: rgba(107, 70, 193, 0.3);
}

.btn-soft-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-soft-success:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-soft-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.btn-soft-warning:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #D97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-soft-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-soft-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #DC2626;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Button Sizes */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-xl {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
}

/* Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
}

.btn-icon-lg {
    width: 48px;
    height: 48px;
}

/* Enhanced Badge Components */
.badge-soft-primary {
    background: rgba(107, 70, 193, 0.1);
    color: var(--primary-purple);
}

.badge-soft-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-soft-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-soft-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-soft-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-outline-primary {
    background: transparent;
    color: var(--primary-purple);
    border: 1px solid var(--primary-purple);
}

.badge-outline-success {
    background: transparent;
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-outline-warning {
    background: transparent;
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-outline-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

/* Enhanced Input Components */
.form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
}

.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.input-group-modern {
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-group-modern .form-control {
    border: 1px solid var(--gray-300);
    box-shadow: none;
}

.input-group-modern .input-group-text {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

.input-group-modern:focus-within {
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.input-group-modern:focus-within .form-control {
    border-color: var(--primary-purple);
}

.input-group-modern:focus-within .input-group-text {
    border-color: var(--primary-purple);
    background: var(--purple-tint);
    color: var(--primary-purple);
}

/* Switch/Toggle Components */
.custom-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.custom-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 24px;
}

.custom-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-switch input:checked + .slider {
    background-color: var(--primary-purple);
}

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

/* Enhanced List Group */
.list-group-modern .list-group-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.15s ease-out;
}

.list-group-modern .list-group-item:hover {
    background: var(--purple-tint);
    border-color: var(--primary-purple);
    transform: translateX(4px);
}

.list-group-modern .list-group-item.active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: white;
}

/* Enhanced Nav Tabs */
.nav-tabs-modern {
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.nav-tabs-modern .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.15s ease-out;
}

.nav-tabs-modern .nav-link:hover {
    border-bottom-color: var(--primary-purple-light);
    color: var(--primary-purple);
    background: var(--purple-tint);
}

.nav-tabs-modern .nav-link.active {
    border-bottom-color: var(--primary-purple);
    color: var(--primary-purple);
    background: var(--purple-tint);
}

/* Enhanced Accordion */
.accordion-modern .card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-modern .card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 0;
}

.accordion-modern .card-header button {
    background: none;
    border: none;
    width: 100%;
    text-align: right;
    padding: 1rem 1.5rem;
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.15s ease-out;
}

.accordion-modern .card-header button:hover {
    background: var(--purple-tint);
    color: var(--primary-purple);
}

.accordion-modern .card-header button[aria-expanded="true"] {
    background: var(--primary-purple);
    color: white;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-purple);
    animation: spin 1s ease-in-out infinite;
}

.loading-spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-button {
    height: 2.5rem;
    width: 100px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced Tooltips */
.tooltip-modern .tooltip-inner {
    background: var(--gray-800);
    color: white;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
}

.tooltip-modern .arrow::before {
    border-top-color: var(--gray-800);
}

/* Enhanced Popovers */
.popover-modern {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.popover-modern .popover-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-weight: 600;
}

.popover-modern .popover-body {
    color: var(--gray-600);
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-online::before {
    background: var(--success);
}

.status-offline {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray-500);
}

.status-offline::before {
    background: var(--gray-500);
}

.status-busy {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.status-busy::before {
    background: var(--error);
}

.status-away {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-away::before {
    background: var(--warning);
}

/* Enhanced File Upload */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.15s ease-out;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-purple);
    background: var(--purple-tint);
}

.file-upload-area.dragover {
    border-color: var(--primary-purple);
    background: var(--purple-tint);
    transform: scale(1.02);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.file-upload-text {
    color: var(--gray-600);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Enhanced Search */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box .form-control {
    padding-left: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    transition: all 0.15s ease-out;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 5;
}

.search-box .form-control:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.search-box .form-control:focus + .search-icon {
    color: var(--primary-purple);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .btn-responsive {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .card-stats {
        margin-bottom: 1rem;
    }
    
    .nav-tabs-modern .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .file-upload-area {
        padding: 1.5rem 1rem;
    }
    
    .file-upload-icon {
        font-size: 2rem;
    }
    
    .file-upload-text {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .btn, .dropdown, .pagination, .card-actions {
        display: none !important;
    }
    
    .card {
        border: 1px solid var(--gray-300) !important;
        box-shadow: none !important;
    }
    
    .table {
        border-collapse: collapse !important;
    }
    
    .table th, .table td {
        border: 1px solid var(--gray-300) !important;
    }
}

