@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/**
 * Global Reusable Components CSS
 * Stock Portfolio Tracker - Wealth Management
 * 
 * This file contains common component styles used across the application:
 * - CSS Variables (colors, spacing, shadows)
 * - Buttons (primary, secondary, danger)
 * - Forms (inputs, labels, validation)
 * - Modals (dialogs, overlays)
 * - Badges & Notifications
 * - Loading states
 * - Page headers
 */

/* ================================================
   CSS VARIABLES - Global Design Tokens
   ================================================ */
:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    
    /* Background Colors */
    --bg-sidebar: #1e293b;
    --bg-content: #ffffff;
    --bg-hover: #f8fafc;
    --bg-gray: #f9fafb;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-inverse: #ffffff;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Border & Spacing */
    --border-color: #e5e7eb;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Shadows */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ================================================
   BUTTONS - Global Button Components
   ================================================ */

/* Base Button */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}

.btn i {
    font-size: 1em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

/* Secondary Button */
.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: white;
    border: none;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

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

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

/* Small Button Size */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Large Button Size */
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ================================================
   BADGES - Status & Label Components
   ================================================ */

/* Base Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    line-height: 1.2;
}

/* Status Badges */
.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

/* Contextual Badges */
.badge-info {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-currency {
    background: #dcfce7;
    color: #166534;
}

.badge-type {
    background: #dbeafe;
    color: #1e40af;
}

.badge-exchange {
    background: #f3f4f6;
    color: #374151;
}

.badge-light {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* Small/Table Badge Variant - Compact, square design for tables */
.badge.badge-sm,
.badge.badge-table {
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block !important;
    min-width: 32px;
    text-align: center;
}

/* Table badge color overrides - solid backgrounds with white text */
.badge.badge-sm.badge-success {
    background: #10b981 !important;
    color: white !important;
}

.badge.badge-sm.badge-warning {
    background: #f59e0b !important;
    color: white !important;
}

.badge.badge-sm.badge-danger {
    background: #ef4444 !important;
    color: white !important;
}

.badge.badge-sm.badge-primary {
    background: #3b82f6 !important;
    color: white !important;
}

.badge.badge-sm.badge-secondary {
    background: #6b7280 !important;
    color: white !important;
}

.badge.badge-sm.badge-info {
    background: #8b5cf6 !important;
    color: white !important;
}

.badge.badge-sm.badge-currency {
    background: #10b981 !important;
    color: white !important;
}

.badge.badge-sm.badge-type {
    background: #3b82f6 !important;
    color: white !important;
}

.badge.badge-sm.badge-exchange {
    background: #6b7280 !important;
    color: white !important;
}

.badge.badge-sm.badge-light {
    background: #9ca3af !important;
    color: white !important;
    border: none !important;
}

/* Notification Badge (for counters) */
.message-badge, 
.discussion-badge,
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Pulsing animation for notification badges */
@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 8px rgba(220, 38, 38, 0.6);
    }
}

.message-badge.pulse,
.discussion-badge.pulse,
.notification-badge.pulse {
    animation: pulse-badge 2s ease-in-out infinite;
}

/* ================================================
   ICON BUTTONS - Circular Action Icons
   ================================================ */

.icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-inverse);
    text-decoration: none;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    transform: scale(1.05);
}

.icon-button i {
    font-size: 1.1rem;
}

/* Icon Button on light backgrounds */
.icon-button.light {
    background: var(--bg-gray);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.icon-button.light:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

/* Legacy class names for backwards compatibility */
.message-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 16px;
    color: var(--text-inverse);
    text-decoration: none;
}

.message-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
}

.message-icon i {
    font-size: 1.1rem;
}

/* ================================================
   FORMS - Input & Form Components
   ================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: var(--bg-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group .error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
}

.form-group .help-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.required {
    color: var(--danger);
}

/* Input Group (for prefix/suffix) */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-prepend,
.input-group-append {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.input-group-prepend {
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.input-group-append {
    border-left: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.input-group input {
    border-radius: 0 !important;
}

.input-group-prepend + input {
    border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
}

.input-group input + .input-group-append {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* ================================================
   MODALS - Dialog & Overlay Components
   ================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    max-width: 900px;
}

.modal-content.modal-sm {
    max-width: 400px;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ================================================
   PAGE HEADER - Consistent Page Titles
   ================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header .actions {
    display: flex;
    gap: 12px;
}

/* ================================================
   LOADING STATES - Spinners & Skeletons
   ================================================ */

/* ================================================
   LOADING SPINNERS
   ================================================ */

/* Full-page/Section Loading Spinner
   Usage: 
   <div class="loading-spinner">
       <i class="fa fa-spinner"></i> Loading...
   </div>
   
   IMPORTANT: Do NOT add fa-spin class - animation handled by CSS!
   The child selector (>) ensures spinner styles don't leak to nested elements. */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    min-height: 300px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Only target direct child icons (spinner itself), not nested elements like buttons */
.loading-spinner > i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

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

/* Inline Button Spinner
   Usage: btn.innerHTML = '<i class="fa fa-spinner fa-spin"></i> Loading...';
   Note: Keep fa-spin class for inline spinners (not in .loading-spinner container) */

/* Inline Spinner (for icons outside .loading-spinner container)
   Usage: <i class="fa fa-spinner fa-spin"></i> or btn.innerHTML = '<i class="fa fa-spinner fa-spin"></i> Loading...'
   Note: Use fa-spin class for inline spinners in buttons, status indicators, etc. */
.fa-spin {
    animation: spin 1s linear infinite;
}

.spinner-inline {
    display: inline-block;
    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;
}

/* ================================================
   CARDS - Content Containers
   ================================================ */

.card {
    background: var(--bg-content);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-gray);
}

/* ================================================
   ALERTS - Status Messages
   ================================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: #dbeafe;
    color: #1e3a8a;
    border-left: 4px solid var(--primary);
}

/* ================================================
   TABLES - Data Display
   ================================================ */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-gray);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

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

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

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

/* ================================================
   TABS - Tabbed Navigation
   ================================================ */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    padding: 0 4px;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
    font-family: inherit;
}

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

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

.tab-button i {
    font-size: 1rem;
}

/* Tab Content Panels */
.tab-content {
    display: block;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ================================================
   TABLE ACTION BUTTONS - Compact Icon Buttons for Tables
   ================================================ */

.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-content);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-table-action:hover {
    background: var(--bg-gray);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-table-action i {
    font-size: 0.875rem;
}

/* Edit Button */
.btn-table-action.edit {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-table-action.edit:hover {
    background: var(--primary);
    color: white;
}

/* Delete Button */
.btn-table-action.delete {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-table-action.delete:hover {
    background: var(--danger);
    color: white;
}

/* View/Info Button */
.btn-table-action.view {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-table-action.view:hover {
    background: var(--text-secondary);
    color: white;
}

/* Discuss/Comment Button */
.btn-table-action.discuss {
    color: #6b7280;
    border-color: #e5e7eb;
}

.btn-table-action.discuss:hover {
    background: #eff6ff;
    color: var(--primary);
    border-color: var(--primary);
}

/* Action Button Container */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

/* Legacy class support (backwards compatibility) */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
}

/* ================================================
   UTILITIES - Helper Classes
   ================================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ================================================
   DROPDOWN MENUS - Button with Menu
   ================================================ */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
}

.dropdown-btn:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
}

.dropdown-btn.active {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

.dropdown-btn i.fa-chevron-down {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.dropdown.show .dropdown-btn i.fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

/* Better scrollbar visibility */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu.left {
    right: auto;
    left: 0;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.dropdown-item:hover {
    background: var(--bg-gray);
}

.dropdown-item.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.dropdown-item .fa-check {
    color: var(--primary);
    font-size: 0.875rem;
}

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

/* Dropdown with icon (compact) */
.dropdown-btn.compact {
    padding: 8px 12px;
    font-size: 0.75rem;
}

/* Legacy class names for backwards compatibility */
.sort-filter {
    position: relative;
    display: inline-block;
}

.sort-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
}

.sort-filter-btn:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
}

.sort-filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1000;
    display: none;
}

.sort-filter-dropdown.show {
    display: block;
}

.sort-filter-item {
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-filter-item:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.sort-filter-item:last-child {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.sort-filter-item:hover {
    background: var(--bg-gray);
}

.sort-filter-item.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.sort-filter-item .fa-check {
    color: var(--primary);
}

.location-filter {
    position: relative;
    display: inline-block;
}

.location-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
}

.location-filter-btn:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
}

.location-filter-btn.active {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

.location-filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.location-filter-dropdown.show {
    display: block;
}

.location-filter-item {
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.location-filter-item:first-child {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.location-filter-item:last-child {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.location-filter-item:hover {
    background: var(--bg-gray);
}

.location-filter-item.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
}

.location-filter-item .fa-check {
    color: var(--primary);
}

/* ================================================
   FILTER INPUT - Search/Filter Text Input
   ================================================ */

.filter-input {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    min-width: 200px;
    font-family: inherit;
    transition: all 0.2s;
    line-height: 1.5;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-input::placeholder {
    color: var(--text-secondary);
}

/* Filter Input with Icon */
.filter-input-wrapper {
    position: relative;
    display: inline-block;
}

.filter-input-wrapper .filter-input {
    padding-left: 38px;
}

.filter-input-wrapper .filter-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.9rem;
}
