/**
 * Critical Dark Mode & Search Panel CSS
 * Extracted from index.php lines 53-490
 */

:root {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-panel: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --shadow: 0 4px 15px rgba(102,126,234,0.3);
    --glow: 0 0 20px rgba(102,126,234,0.4);
}

[data-theme="dark"] {
    --bg-primary: #0a0a1a;
    --bg-secondary: #1a1a2e;
    --bg-panel: linear-gradient(135deg, #1a1a3e 0%, #2d1b4e 100%);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --input-bg: #1e293b;
    --shadow: 0 4px 20px rgba(0,0,0,0.5);
    --glow: 0 0 25px rgba(139,92,246,0.5);
}

[data-theme="dark"] body { background: var(--bg-primary) !important; color: var(--text-primary) !important; }
[data-theme="dark"] .enhanced-search-interface { background: var(--bg-panel) !important; }
[data-theme="dark"] .secondary-filters-row { background: rgba(0,0,0,0.3) !important; }

/* 🔥 TOP-TIER COMPACT SEARCH PANEL */
.search-panel-elite {
    background: var(--bg-panel);
    padding: 16px 20px;
    border-radius: 16px;
    margin: 10px auto;
    max-width: 900px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.search-panel-elite::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 8s infinite linear;
    pointer-events: none;
}
@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.search-header-elite {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.search-title-elite {
    font-size: 18px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.search-subtitle-elite {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    margin-top: 2px;
}

/* Document Type Buttons - 3D Animated */
.doc-type-group-elite {
    display: flex;
    gap: 6px;
}
.doc-type-btn-3d {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}
.doc-type-btn-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}
.doc-type-btn-3d:hover::before { left: 100%; }
.doc-type-btn-3d:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border-color: white;
}
.doc-type-btn-3d.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 15px rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Search Input Row */
.search-row-elite {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
}
.search-input-elite {
    flex: 1;
    padding: 10px 16px;
    padding-right: 40px;
    border-radius: 25px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.95);
    font-size: 14px;
    color: #1e293b;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.search-input-elite:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2), inset 0 2px 4px rgba(0,0,0,0.05);
}
.search-input-elite::placeholder { color: #94a3b8; }

/* Search Button - 3D Animated */
.search-btn-3d {
    padding: 10px 24px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(16,185,129,0.4), inset 0 -3px 0 rgba(0,0,0,0.15);
    transform-style: preserve-3d;
    white-space: nowrap;
}
.search-btn-3d:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16,185,129,0.5), inset 0 -3px 0 rgba(0,0,0,0.15);
}
.search-btn-3d:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16,185,129,0.4), inset 0 2px 0 rgba(0,0,0,0.15);
}

/* Filter Row - ULTRA COMPACT 50% reduction */
.filter-row-elite {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}
.filter-group-elite {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
}
.filter-label-elite {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.filter-input-elite,
.filter-select-elite {
    padding: 3px 6px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.9);
    font-size: 11px;
    color: #1e293b;
    min-width: 60px;
    transition: all 0.2s;
    height: 24px;
}
.filter-select-elite { cursor: pointer; min-width: 70px; }
.filter-input-elite:focus,
.filter-select-elite:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

/* Strict Filter Styles */
.strict-filter-input {
    border-color: #e53e3e !important;
    background: linear-gradient(135deg, #fff5f5, #ffffff) !important;
}
.strict-filter-input:focus {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2) !important;
}
.strict-filter-input::placeholder {
    color: #e53e3e;
    opacity: 0.6;
}
.search-highlight-primary {
    background: linear-gradient(135deg, #fef08a, #fde047);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}
.search-highlight-strict {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    padding: 2px 4px;
    border-radius: 3px;
    border-bottom: 2px solid #ea580c;
    font-weight: 600;
}
.strict-filter-badge {
    background: #e53e3e;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}
.strict-filter-label {
    color: #e53e3e !important;
    font-weight: 800 !important;
}

/* AI Toggle & Clear Button - COMPACT */
.action-group-elite {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.ai-toggle-elite {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}
.ai-toggle-elite:hover { background: rgba(255,255,255,0.25); }
.ai-toggle-elite .toggle-switch {
    width: 26px;
    height: 14px;
    background: rgba(255,255,255,0.3);
    border-radius: 7px;
    position: relative;
    transition: all 0.3s;
}
.ai-toggle-elite .toggle-switch.on { background: #10b981; }
.ai-toggle-elite .toggle-switch::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ai-toggle-elite .toggle-switch.on::after { left: 12px; }

.clear-btn-3d {
    padding: 3px 8px;
    border-radius: 5px;
    border: none;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(239,68,68,0.3), inset 0 -1px 0 rgba(0,0,0,0.15);
    height: 22px;
}
.clear-btn-3d:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239,68,68,0.4);
}
.clear-btn-3d:active { transform: translateY(0); }

/* New Search Button - Prominent 3D style */
.new-search-btn-3d {
    padding: 3px 10px;
    border-radius: 5px;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(59,130,246,0.3), inset 0 -1px 0 rgba(0,0,0,0.15);
    height: 22px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.new-search-btn-3d:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59,130,246,0.4);
}
.new-search-btn-3d:active { transform: translateY(0); }

/* Dark Mode Toggle Button - Search Panel Only */
.dark-mode-btn {
    padding: 3px 8px;
    border-radius: 5px;
    border: none;
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(71,85,105,0.3);
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark-mode-btn:hover { transform: translateY(-1px); }

/* Document Type Buttons - 3D COMPACT */
.doc-type-btn-3d {
    border-radius: 5px;
    border: 1px solid;
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.doc-type-btn-3d:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.doc-type-btn-3d.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-color: transparent;
}

/* Example Buttons - 3D COMPACT */
.example-btn {
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}
.example-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* Pro Tip */
.pro-tip-elite {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.15);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}
.pro-tip-elite .tip-icon {
    font-size: 16px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Dark mode SEARCH PANEL ONLY - scoped to .search-panel-dark */
.search-panel-dark .search-input-elite,
.search-panel-dark .filter-input-elite,
.search-panel-dark .filter-select-elite {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}
.search-panel-dark .filter-label-elite {
    color: rgba(226,232,240,0.8);
}
.search-panel-dark .filter-row-elite {
    background: rgba(30,41,59,0.3);
}
.search-panel-dark .search-filters {
    background: rgba(30,41,59,0.2);
}
