/* ================================================================
   NexaBoard - UI Components Styles
   ================================================================ */

/* Component Preview */
.component-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.component-code {
    background: var(--secondary-900);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    overflow-x: auto;
}

.component-code pre {
    margin: 0;
}

.component-code code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: #e2e8f0;
    line-height: 1.7;
}

/* ================================================================
   Extended Button Styles
   ================================================================ */

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-600), var(--success-700));
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-600), var(--warning-700));
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-600), var(--danger-700));
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* Info Button */
.btn-info {
    background: linear-gradient(135deg, var(--info-500), var(--info-600));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--info-600), var(--info-700));
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Outline Buttons */
.btn-outline-primary {
    background: transparent;
    color: var(--primary-500);
    border: 2px solid var(--primary-500);
}

.btn-outline-primary:hover {
    background: var(--primary-500);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--secondary-500);
    border: 2px solid var(--secondary-400);
}

.btn-outline-secondary:hover {
    background: var(--secondary-500);
    color: white;
}

.btn-outline-success {
    background: transparent;
    color: var(--success-500);
    border: 2px solid var(--success-500);
}

.btn-outline-success:hover {
    background: var(--success-500);
    color: white;
}

.btn-outline-warning {
    background: transparent;
    color: var(--warning-600);
    border: 2px solid var(--warning-500);
}

.btn-outline-warning:hover {
    background: var(--warning-500);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger-500);
    border: 2px solid var(--danger-500);
}

.btn-outline-danger:hover {
    background: var(--danger-500);
    color: white;
}

.btn-outline-info {
    background: transparent;
    color: var(--info-500);
    border: 2px solid var(--info-500);
}

.btn-outline-info:hover {
    background: var(--info-500);
    color: white;
}

/* Soft Buttons */
.btn-soft-primary {
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary-600);
}

.btn-soft-primary:hover {
    background: rgba(20, 184, 166, 0.2);
}

.btn-soft-secondary {
    background: rgba(100, 116, 139, 0.12);
    color: var(--secondary-600);
}

.btn-soft-secondary:hover {
    background: rgba(100, 116, 139, 0.2);
}

.btn-soft-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-600);
}

.btn-soft-success:hover {
    background: rgba(34, 197, 94, 0.2);
}

.btn-soft-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-700);
}

.btn-soft-warning:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-soft-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-600);
}

.btn-soft-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-soft-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info-600);
}

.btn-soft-info:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Button Sizes */
.btn-xs {
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-xl {
    padding: 1rem 2.25rem;
    font-size: 1.125rem;
}

/* Icon Only Buttons */
.btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
}

.btn-icon-only i {
    font-size: 1.25rem;
}

.btn-rounded {
    border-radius: var(--radius-full);
}

/* Loading Button */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Disabled State */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button Group */
.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    margin-left: 0;
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn.active {
    z-index: 1;
}

.btn-group .btn-outline-primary.active {
    background: var(--primary-500);
    color: white;
}

/* ================================================================
   Alerts
   ================================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.alert-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon i {
    font-size: 1.25rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    opacity: 0.9;
}

.alert-close {
    padding: 0.25rem;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

.alert-primary {
    background: rgba(20, 184, 166, 0.12);
    color: var(--primary-700);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-700);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-700);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-700);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info-700);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ================================================================
   Progress Bars
   ================================================================ */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, var(--success-400), var(--success-600));
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, var(--warning-400), var(--warning-600));
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, var(--danger-400), var(--danger-600));
}

.progress-bar.bg-info {
    background: linear-gradient(90deg, var(--info-400), var(--info-600));
}

/* Progress Sizes */
.progress-sm {
    height: 4px;
}

.progress-lg {
    height: 12px;
}

/* Progress with Label */
.progress-label {
    height: 20px;
}

.progress-label .progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
}

/* ================================================================
   Tooltips
   ================================================================ */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-wrapper .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: var(--secondary-900);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 1000;
}

.tooltip-wrapper .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--secondary-900);
}

.tooltip-wrapper:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

/* ================================================================
   Avatars
   ================================================================ */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--primary-100);
    color: var(--primary-600);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.125rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.5rem; }

.avatar-rounded { border-radius: var(--radius-full); }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 3px solid var(--bg-secondary);
    margin-left: -12px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ================================================================
   Modals
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-normal);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Modal Sizes */
.modal-sm { max-width: 350px; }
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 900px; }

/* ================================================================
   Tabs
   ================================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0.5rem;
}

.tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-500);
    border-bottom-color: var(--primary-500);
}

.tab-content {
    padding: 1.5rem 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Pills Tabs */
.tabs-pills {
    border-bottom: none;
    background: var(--bg-tertiary);
    padding: 0.375rem;
    border-radius: var(--radius-lg);
}

.tabs-pills .tab {
    border-bottom: none;
    border-radius: var(--radius-md);
    margin-bottom: 0;
}

.tabs-pills .tab.active {
    background: var(--bg-secondary);
    color: var(--primary-500);
    box-shadow: var(--shadow-sm);
}

/* ================================================================
   Accordions
   ================================================================ */
.accordion {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    text-align: left;
    transition: var(--transition-fast);
}

.accordion-header:hover {
    background: var(--bg-tertiary);
}

.accordion-header i {
    transition: var(--transition-fast);
}

.accordion-item.open .accordion-header i {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: var(--transition-normal);
}

.accordion-item.open .accordion-body {
    max-height: 500px;
}

.accordion-content {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
