/* =============================================================================
   COMPONENT STYLES
   Additional components beyond the unified design system
   ============================================================================= */

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.loading {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-elevated) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-lg);
}

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

    100% {
        background-position: -200% 0;
    }
}

/* =============================================================================
   MODALS
   ============================================================================= */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-backdrop);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

/* Futuristic Mode: Add backdrop blur */
[data-theme="futuristic"] .modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background-color: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--modal-shadow);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-base);
}

/* Futuristic Mode: Add backdrop filter to modal */
[data-theme="futuristic"] .modal {
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

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

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

.modal-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* =============================================================================
   ALERTS
   ============================================================================= */

.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

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

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

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

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

/* =============================================================================
   TABS
   ============================================================================= */

.tabs {
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-6);
}

.tab-list {
    display: flex;
    gap: var(--space-2);
    list-style: none;
}

.tab-button {
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    transition: all var(--transition-fast);
}

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

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

/* Futuristic Mode: Add glow to active tab */
[data-theme="futuristic"] .tab-button.active {
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-base) ease-out;
}

/* =============================================================================
   DROPDOWN
   ============================================================================= */

.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    background-color: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--modal-shadow);
    min-width: 200px;
    z-index: var(--z-dropdown);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

/* Futuristic Mode: Add backdrop filter */
[data-theme="futuristic"] .dropdown-menu {
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.dropdown-item {
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.dropdown-item:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.dropdown-item:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.dropdown-item:hover {
    background-color: var(--btn-secondary-hover-bg);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-primary);
    margin: var(--space-2) 0;
}

/* =============================================================================
   PROGRESS BAR
   ============================================================================= */

.progress {
    width: 100%;
    height: 8px;
    background-color: var(--progress-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--progress-fill);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* Futuristic Mode: Add glow to progress bar */
[data-theme="futuristic"] .progress-bar {
    box-shadow: var(--progress-glow);
}

.progress-sm {
    height: 4px;
}

.progress-lg {
    height: 12px;
}

/* =============================================================================
   AVATAR
   ============================================================================= */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    overflow: hidden;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--text-xs);
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: var(--text-sm);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: var(--text-2xl);
}

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

/* =============================================================================
   TOOLTIP
   ============================================================================= */

.tooltip {
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: var(--z-tooltip);
    transition: opacity var(--transition-fast);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-description {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

/* =============================================================================
   LIST GROUP
   ============================================================================= */

.list-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
}

.list-item:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary);
}

.list-item-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.list-item-description {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.list-item-action {
    flex-shrink: 0;
}

/* =============================================================================
   TABLE
   ============================================================================= */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--bg-secondary);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-primary);
}

.table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* =============================================================================
   BREADCRUMB
   ============================================================================= */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* =============================================================================
   STAT CARD
   ============================================================================= */

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-change {
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}