/**
 * Feuille de style Premium - Inspecteur de Code Cabinex
 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --search-bg-color: #0f172a;
    --search-card-bg: rgba(255, 255, 255, 0.7);
    --search-card-dark: #1e293b;
    --search-text-main: #334155;
    --search-text-light: #64748b;
    --search-primary: #4f46e5;
    --search-primary-hover: #4338ca;
    --search-danger: #ef4444;
    --search-danger-hover: #dc2626;
    --search-success: #10b981;
    --search-border: rgba(226, 232, 240, 0.8);
    --search-font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --search-accent: #f59e0b;
}

#search-module-wrapper {
    font-family: var(--search-font);
    color: var(--search-text-main);
    background: radial-gradient(circle at 10% 20%, rgba(241, 245, 249, 1) 0%, rgba(226, 232, 240, 0.4) 90%);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin: 15px;
}

#search-module-wrapper header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--search-border);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

#search-module-wrapper h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

#search-module-wrapper .btn-premium {
    font-family: var(--search-font);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

#search-module-wrapper .btn-premium-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

#search-module-wrapper .btn-premium-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

#search-module-wrapper .btn-premium-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--search-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

#search-module-wrapper .btn-premium-danger:hover {
    background: var(--search-danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

#search-module-wrapper .search-card {
    background: var(--search-card-bg);
    border: 1px solid var(--search-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
}

#search-module-wrapper .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#search-module-wrapper label {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#search-module-wrapper .search-input-wrapper {
    display: flex;
    gap: 12px;
}

#search-module-wrapper input[type="text"] {
    flex-grow: 1;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    font-size: 15px;
    font-family: monospace;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
}

#search-module-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Custom checkable badge pills for target folders */
#search-module-wrapper .directory-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

#search-module-wrapper .directory-pill {
    position: relative;
    cursor: pointer;
    user-select: none;
}

#search-module-wrapper .directory-pill input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

#search-module-wrapper .directory-pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #cbd5e1;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#search-module-wrapper .directory-pill:hover .directory-pill-label {
    background: #e2e8f0;
    border-color: #94a3b8;
}

#search-module-wrapper .directory-pill input:checked + .directory-pill-label {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border-color: #818cf8;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

#search-module-wrapper .directory-pill input:checked + .directory-pill-label i {
    color: #4f46e5;
}

/* Stats grid */
#search-module-wrapper .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

#search-module-wrapper .stat-box {
    background: #f8fafc;
    border: 1px solid var(--search-border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    transition: transform 0.2s;
}

#search-module-wrapper .stat-box:hover {
    transform: translateY(-2px);
}

#search-module-wrapper .stat-val {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

#search-module-wrapper .stat-lbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--search-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#search-module-wrapper .alert-premium {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

#search-module-wrapper .alert-premium-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

#search-module-wrapper .alert-premium-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* Accordion grouped results */
#search-module-wrapper .file-group {
    background: white;
    border: 1px solid var(--search-border);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

#search-module-wrapper .file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

#search-module-wrapper .file-header:hover {
    background: #f1f5f9;
}

#search-module-wrapper .file-path {
    font-family: monospace;
    font-size: 13.5px;
    color: #1e293b;
    font-weight: 500;
    word-break: break-all;
}

#search-module-wrapper .file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#search-module-wrapper .badge-count {
    background: #6366f1;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

#search-module-wrapper .file-chevron {
    transition: transform 0.25s;
    color: #94a3b8;
}

#search-module-wrapper .file-group.active .file-chevron {
    transform: rotate(90deg);
}

#search-module-wrapper .file-body {
    display: none;
    border-top: 1px solid var(--search-border);
    background: #fafafa;
}

#search-module-wrapper .file-group.active .file-body {
    display: block;
}

/* Code table style */
#search-module-wrapper .code-table {
    width: 100%;
    border-collapse: collapse;
}

#search-module-wrapper .code-row {
    border-bottom: 1px solid #f1f5f9;
    display: table-row;
}

#search-module-wrapper .code-row:last-child {
    border-bottom: none;
}

#search-module-wrapper .code-line-num {
    width: 60px;
    text-align: right;
    padding: 8px 16px;
    font-family: monospace;
    color: #94a3b8;
    background: #f1f5f9;
    font-size: 12px;
    user-select: none;
    border-right: 1.5px solid #e2e8f0;
}

#search-module-wrapper .code-content-cell {
    padding: 8px 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    background: #0f172a;
    color: #cbd5e1;
}

#search-module-wrapper .code-match-highlight {
    background-color: rgba(245, 158, 11, 0.35);
    border-bottom: 2px solid var(--search-accent);
    color: #fef08a;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Loading animations */
#search-module-wrapper .pulse-loader {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#search-module-wrapper .pulse-loader span {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.2s infinite ease-in-out both;
}

#search-module-wrapper .pulse-loader span:nth-child(1) { animation-delay: -0.32s; }
#search-module-wrapper .pulse-loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

#search-module-wrapper .fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
