/* =====================================================================
   PORTFOLIO DE DOMAINES PREMIUM — Feuille de style principale
   =====================================================================
   Thème sombre premium, responsive mobile-first, support RTL (arabe).
   Les couleurs proviennent des variables --* définies dans index.php
   (depuis config.php 'theme'). Modifiez-les dans config.php.
   ===================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Segoe UI', 'Helvetica Neue', system-ui, -apple-system, 'Noto Sans Arabic', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(11, 16, 32, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; height: 68px;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-mark {
    color: var(--accent); font-size: 1.5rem;
    display: inline-block; line-height: 1;
}
.brand-text { white-space: nowrap; }

.main-nav { display: flex; gap: 1.5rem; }
.main-nav a {
    color: var(--text-muted); font-weight: 600; font-size: 0.95rem;
    padding: 0.4rem 0; transition: color 0.15s;
    position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 0; height: 2px; background: var(--accent); transition: width 0.2s;
}
.main-nav a:hover::after { width: 100%; }

.lang-switcher { display: flex; gap: 0.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem; }
.lang-link {
    padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
    color: var(--text-muted); transition: all 0.15s;
}
.lang-link:hover { color: var(--text); }
.lang-link.active { background: var(--accent); color: #fff; }

/* ---------- Hero ---------- */
.hero {
    text-align: center; padding: 4.5rem 1.25rem 3rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, color-mix(in srgb, var(--accent) 25%, transparent), transparent),
        var(--bg);
    border-bottom: 1px solid var(--border);
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800;
    line-height: 1.1; letter-spacing: -0.03em;
    background: linear-gradient(180deg, #fff, var(--text));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem); color: var(--text-muted);
    max-width: 640px; margin: 0 auto 2rem;
}
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }

/* ---------- Stats bar ---------- */
.stats-bar {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; max-width: 720px; margin: 0 auto;
}
.stat {
    flex: 1 1 140px; text-align: center; padding: 0.5rem;
}
.stat + .stat { border-left: 1px solid var(--border); }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.stat-label { display: block; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.65rem 1.25rem; border-radius: 10px;
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    border: 1px solid transparent; transition: all 0.15s;
    text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-link { background: transparent; color: var(--text-muted); padding: 0.5rem 0.75rem; }
.btn-link:hover { color: var(--accent); }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.05rem; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---------- Sections ---------- */
.portfolio-section, .faq-section, .contact-section { padding: 4rem 0; }
.faq-section { background: var(--bg-alt); }
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800;
    text-align: center; margin-bottom: 0.5rem; letter-spacing: -0.02em;
}
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; }

/* ---------- Filters bar ---------- */
.filters-bar {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem;
}
.filter-search { flex: 1 1 240px; min-width: 200px; }
.filter-search input {
    width: 100%; padding: 0.65rem 0.9rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text);
}
.filter-search input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.filter-group { display: flex; flex-direction: column; gap: 0.25rem; min-width: 130px; }
.filter-group label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.filter-group select {
    padding: 0.55rem 0.7rem; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); cursor: pointer;
}
.filter-group select:focus { outline: 2px solid var(--accent); }

.results-count { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ---------- Domain grid & cards ---------- */
.domains-grid {
    display: grid; gap: 1.1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.domain-card {
    position: relative; display: flex; flex-direction: column; gap: 0.75rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.4rem;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.domain-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.domain-card.is-featured {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--bg-card)), var(--bg-card));
}
.badge-featured {
    position: absolute; top: -0.6rem; left: 1rem;
    background: var(--accent); color: #fff;
    font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem;
    border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.domain-name {
    font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em;
    word-break: break-all; line-height: 1.2;
}
.domain-ext {
    font-size: 0.75rem; font-weight: 700; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    padding: 0.15rem 0.5rem; border-radius: 6px; white-space: nowrap;
}
.domain-desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.45; min-height: 2.6em; }
.domain-meta { display: flex; flex-direction: column; gap: 0.1rem; margin-top: auto; }
.price { font-size: 1.7rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.price-offer { font-size: 1.1rem; color: var(--accent); }
.price-sub { font-size: 0.8rem; color: var(--text-muted); }

.card-actions { display: flex; gap: 0.5rem; }

/* Marketplace list (dépliable) */
.marketplace-list { border-top: 1px dashed var(--border); padding-top: 0.75rem; }
.marketplace-list summary {
    cursor: pointer; font-size: 0.85rem; color: var(--text-muted);
    font-weight: 600; list-style: none; user-select: none;
}
.marketplace-list summary::-webkit-details-marker { display: none; }
.marketplace-list summary::before { content: '▸ '; transition: transform 0.15s; display: inline-block; }
.marketplace-list[open] summary::before { transform: rotate(90deg); }
.marketplace-list summary:hover { color: var(--accent); }
.mp-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.6rem; }
.mp-btn {
    padding: 0.45rem 0.5rem; font-size: 0.78rem; font-weight: 600;
    text-align: center; border-radius: 7px;
    background: color-mix(in srgb, var(--mp-color, var(--accent)) 16%, transparent);
    color: var(--mp-color, var(--accent));
    border: 1px solid color-mix(in srgb, var(--mp-color, var(--accent)) 30%, transparent);
    transition: all 0.15s;
}
.mp-btn:hover { background: var(--mp-color, var(--accent)); color: #fff; }
.mp-email { background: var(--bg); color: var(--text-muted); border-color: var(--border); }
.mp-email:hover { background: var(--accent); color: #fff; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.empty-state h3 { font-size: 1.4rem; color: var(--text); margin-bottom: 0.5rem; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem;
    margin-top: 3rem;
}
.page-link {
    min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0 0.75rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-weight: 600; transition: all 0.15s;
}
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination-info { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-top: 0.75rem; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem 1.25rem; transition: border-color 0.15s;
}
.faq-item[open] { border-color: var(--accent); }
.faq-item summary {
    cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.4rem; color: var(--accent); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--text-muted); margin-top: 0.75rem; line-height: 1.7; }

/* ---------- Contact ---------- */
.contact-section { text-align: center; }
.contact-inner { max-width: 640px; margin: 0 auto; }
.contact-section h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 3rem; margin-top: 2rem; }
.footer-inner {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
    padding-bottom: 2.5rem;
}
.footer-col { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-muted); font-size: 0.92rem; transition: color 0.15s; }
.footer-col a:hover { color: var(--accent); }
.footer-tagline { color: var(--text-muted); font-size: 0.9rem; max-width: 320px; margin-top: 0.5rem; }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.5rem 0; }
.footer-bottom p { color: var(--text-muted); font-size: 0.82rem; text-align: center; }
.footer-disclaimer { margin-top: 0.4rem; font-size: 0.75rem !important; opacity: 0.7; }

/* =====================================================================
   RTL — ARABIC (دعم الاتجاه من اليمين لليسار)
   ===================================================================== */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .header-inner { flex-direction: row-reverse; }
[dir="rtl"] .stat + .stat { border-left: none; border-right: 1px solid var(--border); }
[dir="rtl"] .badge-featured { left: auto; right: 1rem; }
[dir="rtl"] .marketplace-list summary::before { content: '◂ '; }
[dir="rtl"] .footer-inner { direction: rtl; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 880px) {
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .main-nav { display: none; }
}
@media (max-width: 600px) {
    .hero { padding-top: 3rem; }
    .stats-bar { flex-direction: column; }
    .stat + .stat { border-left: none; border-top: 1px solid var(--border); }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { width: 100%; }
    .footer-inner { grid-template-columns: 1fr; }
    .mp-buttons { grid-template-columns: 1fr; }
    .domains-grid { grid-template-columns: 1fr; }
}

/* ---------- Accessibilité ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
