
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

:root {
--primary: #bc0101;
--primary-rgb: 188, 1, 1;
--bg-light: #f8fafc;
--text-dark: #1e293b;
--text-muted: #64748b;
--border-color: #e2e8f0;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--bg-light);
color: var(--text-dark);
line-height: 1.6;
}

/* ============================================
ÉCRAN DE RECHERCHE
============================================ */

.search-screen {
min-height: 100vh;
display: flex;
flex-direction: column;
}

.search-header {
background: white;
padding: 16px 20px;
display: flex;
align-items: center;
gap: 16px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
position: sticky;
top: 0;
z-index: 100;
}

.back-btn {
width: 40px;
height: 40px;
border: none;
background: var(--bg-light);
border-radius: 50%;
color: var(--text-dark);
font-size: 1.1rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}

.back-btn:hover {
background: var(--border-color);
}

.header-title {
font-size: 1.2rem;
font-weight: 600;
color: var(--text-dark);
}

.search-content {
flex: 1;
padding: 24px 20px;
max-width: 800px;
margin: 0 auto;
width: 100%;
}

/* Section bienvenue */
.welcome-section {
text-align: center;
margin-bottom: 32px;
}

.welcome-icon {
width: 80px;
height: 80px;
margin: 0 auto 20px;
background: linear-gradient(135deg, var(--primary) 0%, rgba(var(--primary-rgb), 0.8) 100%);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 2.5rem;
color: white;
box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.welcome-title {
font-size: 1.75rem;
font-weight: 700;
margin-bottom: 12px;
color: var(--text-dark);
}

.welcome-text {
font-size: 1rem;
color: var(--text-muted);
line-height: 1.6;
}

/* Formulaire de recherche */
.search-form-container {
background: white;
border-radius: 20px;
padding: 24px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
margin-bottom: 32px;
}

.input-group {
margin-bottom: 20px;
}

.input-label {
display: flex;
align-items: center;
gap: 8px;
font-size: 1rem;
font-weight: 600;
color: var(--text-dark);
margin-bottom: 12px;
}

.input-label i {
color: var(--primary);
}

.search-textarea {
width: 100%;
padding: 16px;
border: 2px solid var(--border-color);
border-radius: 12px;
font-size: 1rem;
line-height: 1.6;
resize: none;
font-family: inherit;
transition: all 0.3s;
}

.search-textarea:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.search-textarea.shake {
animation: shake 0.5s;
}

@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-10px); }
75% { transform: translateX(10px); }
}

.input-footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 12px;
}

.voice-btn {
width: 44px;
height: 44px;
border: none;
background: var(--primary);
border-radius: 50%;
color: white;
font-size: 1.1rem;
cursor: pointer;
transition: all 0.3s;
display: flex;
align-items: center;
justify-content: center;
}

.voice-btn:hover {
transform: scale(1.05);
}

.voice-btn.listening {
background: #ef4444;
animation: pulse 1s infinite;
}

@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); opacity: 0.9; }
}

.char-counter {
font-size: 0.9rem;
color: var(--text-muted);
}

.search-submit-btn {
width: 100%;
height: 56px;
border: none;
background: var(--primary);
color: white;
font-size: 1.05rem;
font-weight: 600;
border-radius: 12px;
cursor: pointer;
transition: all 0.3s;
position: relative;
overflow: hidden;
}

.search-submit-btn:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
}

.search-submit-btn .btn-text,
.search-submit-btn .btn-loading {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
transition: opacity 0.3s;
}

.search-submit-btn .btn-loading {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
opacity: 0;
}

.search-submit-btn.loading .btn-text {
opacity: 0;
}

.search-submit-btn.loading .btn-loading {
opacity: 1;
}

.spinner {
width: 20px;
height: 20px;
border: 3px 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); }
}

/* Suggestions */
.suggestions-section {
margin-top: 32px;
}

.suggestions-title {
display: flex;
align-items: center;
gap: 8px;
font-size: 1rem;
font-weight: 600;
color: var(--text-dark);
margin-bottom: 16px;
}

.suggestions-title i {
color: #f59e0b;
}

.suggestions-list {
display: flex;
flex-direction: column;
gap: 10px;
}

.suggestion-item {
background: white;
border: 2px solid var(--border-color);
border-radius: 12px;
padding: 14px 16px;
text-align: left;
font-size: 0.95rem;
color: var(--text-dark);
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 12px;
}

.suggestion-item:hover {
border-color: var(--primary);
background: rgba(var(--primary-rgb), 0.05);
}

.suggestion-item i {
color: var(--primary);
font-size: 1.2rem;
flex-shrink: 0;
}

/* ============================================
ÉCRAN RÉSULTATS
============================================ */

.results-screen {
min-height: 100vh;
display: flex;
flex-direction: column;
background: var(--bg-light);
}

.results-header {
background: white;
padding: 16px 20px;
display: flex;
align-items: center;
gap: 16px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
position: sticky;
top: 0;
z-index: 100;
}

.results-title {
font-size: 1.2rem;
font-weight: 600;
color: var(--text-dark);
}

.results-content {
flex: 1;
padding: 20px;
max-width: 1200px;
margin: 0 auto;
width: 100%;
}

/* ============================================
RESPONSIVE DESKTOP
============================================ */

@media (min-width: 768px) {
.search-content {
padding: 40px 20px;
}

.welcome-icon {
width: 100px;
height: 100px;
font-size: 3rem;
}

.welcome-title {
font-size: 2.25rem;
}

.welcome-text {
font-size: 1.1rem;
}

.search-form-container {
padding: 32px;
}

.suggestions-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
}

.results-content {
padding: 40px 20px;
}
}

@media (min-width: 1024px) {
.suggestions-list {
grid-template-columns: repeat(3, 1fr);
}
}

/* Loading messages rotatifs */
.loading-status {
font-size: 0.85rem;
color: rgba(255,255,255,0.9);
animation: pulse 2s ease-in-out infinite;
margin-top: 8px;
}

@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.6; }
}

/* Progress bar */
.loading-progress {
width: 100%;
height: 4px;
background: rgba(255,255,255,0.2);
border-radius: 2px;
overflow: hidden;
margin-top: 8px;
}

.loading-progress-bar {
height: 100%;
background: white;
width: 0%;
animation: progressLoading 30s linear forwards;
}

@keyframes progressLoading {
0% { width: 0%; }
10% { width: 20%; }
30% { width: 40%; }
50% { width: 60%; }
80% { width: 85%; }
100% { width: 95%; }
}

/* Warning timeout */
.timeout-warning {
position: fixed;
top: 80px;
left: 50%;
transform: translateX(-50%);
background: #f59e0b;
color: white;
padding: 12px 24px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
z-index: 10000;
animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
from {
opacity: 0;
transform: translate(-50%, -20px);
}
to {
opacity: 1;
transform: translate(-50%, 0);
}
}

/* Badge cache */
.cache-badge {
display: inline-flex;
align-items: center;
gap: 4px;
background: #10b981;
color: white;
padding: 4px 12px;
border-radius: 12px;
font-size: 0.75rem;
font-weight: 600;
margin-left: 8px;
}

/* Animation entrée résultats */
.results-content {
animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}