/* === VARIABLES === */
:root {
    --primary: var(--ui-accent);
    --primary-light: var(--ui-accent-soft);
    --primary-dark: var(--ui-accent-2);
    --bg: var(--ui-bg);
    --card: var(--ui-surface);
    --text: var(--ui-text);
    --text-muted: var(--ui-muted);
    --border: var(--ui-border);
    --gold: #f59e0b;
    --silver: #94a3b8;
    --bronze: #b45309;
    --shadow: none;
    --shadow-lg: var(--ui-shadow);
    --radius: var(--ui-radius);
    --radius-sm: var(--ui-radius-sm);
}

/* === BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--ui-font);
    background: var(--bg);
    color: var(--text);
    min-height: calc(100vh - var(--ui-bar-h, 0px));
    line-height: 1.6;
}

/* === HEADER === */
.header {
    background:
        radial-gradient(circle at 85% -20%, rgba(var(--ui-accent-rgb), 0.22), transparent 55%),
        var(--ui-surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding: 2rem 1.5rem;
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-icon { font-size: 2.75rem; flex-shrink: 0; }
.header h1 { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.header-sub { opacity: 0.85; font-size: 0.9rem; margin-top: 0.3rem; }

/* === MAIN === */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* === SEARCH PANEL === */
.search-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.selectors {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.selector-group {
    flex: 1;
    min-width: 180px;
}

.selector-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.selector-group select {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--ui-surface-2);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.selector-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--ui-accent-rgb),.18);
}

.selector-group select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: var(--ui-surface-3);
}

.selector-arrow {
    font-size: 1.75rem;
    color: var(--text-muted);
    padding-bottom: 0.4rem;
    flex-shrink: 0;
    user-select: none;
}

.search-btn {
    padding: 0.65rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-btn:hover:not(:disabled) { background: var(--primary-dark); }
.search-btn:active:not(:disabled) { transform: scale(0.97); }
.search-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === EMPTY STATE === */
.empty-state {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 3rem 2rem;
    text-align: center;
}

.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.25rem; }

.how-it-works {
    list-style: none;
    counter-reset: steps;
    display: inline-flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.how-it-works li {
    counter-increment: steps;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.how-it-works li::before {
    content: counter(steps);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.empty-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

/* === RESULTS === */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-header h2 { font-size: 1.2rem; font-weight: 700; }
.results-sub { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.2rem; }

.reset-btn {
    padding: 0.45rem 1rem;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.reset-btn:hover { border-color: var(--primary); color: var(--primary); }

.info-banner {
    background: var(--ui-accent-soft);
    border: 1px solid rgba(var(--ui-accent-rgb), .3);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* === SITE CARD === */
.site-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 2px solid transparent;
    transition: box-shadow 0.2s, transform 0.15s;
    overflow: hidden;
}

.site-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.site-card.rank-1 { border-color: var(--gold); }
.site-card.rank-2 { border-color: var(--silver); }
.site-card.rank-3 { border-color: #cd7c2e; }

.site-card-inner {
    display: flex;
    align-items: stretch;
}

/* Barre de rang colorée */
.site-rank-bar {
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    flex-shrink: 0;
    color: white;
    gap: 0.25rem;
}

.rank-medal { font-size: 1.6rem; line-height: 1; }
.rank-number { font-size: 0.85rem; font-weight: 700; opacity: 0.9; }

.site-card.rank-1 .site-rank-bar { background: linear-gradient(180deg, #f59e0b, #d97706); }
.site-card.rank-2 .site-rank-bar { background: linear-gradient(180deg, #94a3b8, #64748b); }
.site-card.rank-3 .site-rank-bar { background: linear-gradient(180deg, #d97706, #b45309); }
.site-card:not(.rank-1):not(.rank-2):not(.rank-3) .site-rank-bar {
    background: var(--ui-surface-3);
    color: var(--text-muted);
}

/* Contenu de la carte */
.site-content {
    flex: 1;
    padding: 1.25rem 1.25rem 1rem;
}

.site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.site-name-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.site-name { font-size: 1.1rem; font-weight: 700; }

.site-type {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    background: var(--ui-surface-3);
    color: var(--text-muted);
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
}

/* Badge de score */
.score-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

.score-badge .score-sub {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.7;
}

.score-badge.excellent { background: rgba(34,197,94,.15); color: #4ade80; }
.score-badge.good      { background: rgba(245,158,11,.15); color: #fbbf24; }
.score-badge.ok        { background: rgba(239,68,68,.15); color: #f87171; }

/* Étoiles */
.site-stars {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.65rem;
}

.star { font-size: 0.9rem; }
.star.full  { color: var(--gold); }
.star.half  { color: var(--gold); opacity: 0.7; }
.star.empty { color: var(--ui-border-strong); }
.reviews-count { font-size: 0.78rem; color: var(--text-muted); margin-left: 0.3rem; }

/* Description */
.site-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
    line-height: 1.55;
}

/* Méta infos */
.site-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    margin-bottom: 0.85rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text);
}

.meta-icon { font-size: 0.9rem; }

.price-label {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.price-label.cheap  { color: #4ade80; }
.price-label.mid    { color: #fbbf24; }
.price-label.pricey { color: #f87171; }

/* Badges */
.site-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.badge {
    font-size: 0.73rem;
    padding: 0.2rem 0.55rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

/* Avertissement */
.site-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #fbbf24;
    background: rgba(245,158,11,.1);
    border: 1px solid rgba(245,158,11,.3);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
    line-height: 1.4;
}

/* Bouton visiter */
.site-footer {
    display: flex;
    justify-content: flex-end;
}

.visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.2s;
}

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

/* === FOOTER === */
.footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .header h1 { font-size: 1.3rem; }
    main { padding: 1.25rem 1rem; }
    .selectors { flex-direction: column; }
    .selector-arrow { display: none; }
    .selector-group { min-width: unset; width: 100%; }
    .search-btn { width: 100%; text-align: center; }
    .site-header { flex-direction: column; align-items: flex-start; }
    .site-meta { gap: 0.5rem; }
    .results-header { flex-direction: column; align-items: flex-start; }
}
