/*
 * Feuille de style principale pour BTCUSD.fr
 * Ce fichier définit l&#39;apparence générale du site, notamment les
 * couleurs, la typographie et la mise en page responsive.
 */

/* Variables CSS pour un thème harmonieux */
:root {
    --primary-color: #0a1326; /* bleu foncé pour l&#39;en‑tête et le pied de page */
    --secondary-color: #f2a900; /* nuance dorée rappelant la couleur du Bitcoin */
    --text-color: #222; /* couleur principale du texte */
    --background-color: #ffffff; /* couleur d&#39;arrière‑plan */
    --light-color: #f9fafb; /* arrière‑plan des sections claires */
    --card-background: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --quote-color: #333;
    --table-header-bg: #0a1326;
    --table-header-color: #ffffff;
    --table-row-alt: #f1f5f9;
}

/* Thème sombre : redéfinition des variables quand dark-mode est activé */
body.dark-mode {
    --primary-color: #111827;
    --secondary-color: #fbbf24;
    --text-color: #e5e7eb;
    --background-color: #1f2937;
    --light-color: #111827;
    --card-background: #1e293b;
    --card-shadow: rgba(255, 255, 255, 0.05);
    --quote-color: #d1d5db;
    --table-header-bg: #374151;
    --table-header-color: #f3f4f6;
    --table-row-alt: #1e293b;
}

/* Réinitialisation des marges et paddings par défaut */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

/* Comportement de défilement fluide pour les liens d'ancrage */
html {
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Styles pour les liens externes mis en avant */
.ext-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.ext-link:hover {
    text-decoration: underline;
}

/* En‑tête */
header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 0;
}

header .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Empêcher le logo de changer de couleur ou d'être souligné au survol */
header h1 a,
header h1 a:hover {
    color: inherit;
    text-decoration: none;
}

header nav a {
    margin-left: 1.5rem;
    font-size: 1rem;
    color: #fff;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: var(--secondary-color);
}

/* Section héros / prix */
#prix {
    position: relative;
    background-image: url('images/hero.png');
    background-size: cover;
    background-position: center;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

#prix .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

#prix .hero-content {
    position: relative;
    z-index: 1;
    padding: 0 1rem;
}

#prix h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

#prix .price {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

#prix .update-time {
    font-size: 0.9rem;
    color: #ddd;
}

/* Sections générales */
.section {
    padding: 3rem 1rem;
}

.section.light {
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Cartes d&#39;information */
.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* Cartes d'informations et autres cartes */
.card {
    flex: 1;
    min-width: 260px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--card-shadow);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px var(--card-shadow);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* FAQ */
.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Pied de page */
footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    font-size: 0.85rem;
}

/* Bouton retour en haut */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    text-decoration: none;
    box-shadow: 0 2px 6px var(--card-shadow);
    transition: opacity 0.3s ease;
    opacity: 0.7;
    z-index: 1000;
}

#back-to-top:hover {
    opacity: 1;
}

/* Par défaut masqué, sera affiché via JS quand nécessaire */
#back-to-top.hidden {
    display: none;
}

/* Ajustement de la couleur des titres en mode sombre pour une meilleure lisibilité */
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .card h3,
body.dark-mode .faq-item h3 {
    color: var(--secondary-color);
}

/* Bouton pour changer de thème */
#theme-toggle {
    margin-left: 1rem;
    background: none;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s ease, color 0.3s ease;
}

#theme-toggle:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

/* Infographie blockchain */
.infographic {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0;
}

.infographic .step {
    flex: 1;
    min-width: 240px;
    text-align: center;
    padding: 1rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--card-shadow);
}

.infographic .emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Citations */
.quote {
    font-style: italic;
    margin-bottom: 0.5rem;
    color: var(--quote-color);
}

.author {
    font-weight: bold;
    color: var(--secondary-color);
}

/* Table des détenteurs */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    padding: 0.75rem 1rem;
    text-align: left;
}

table thead th {
    background-color: var(--table-header-bg);
    color: var(--table-header-color);
}

table tbody tr:nth-child(even) {
    background-color: var(--table-row-alt);
}

table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Quiz */
.question {
    margin-bottom: 1.5rem;
}

#quiz-form label {
    margin-left: 0.5rem;
}

#submit-quiz {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

#submit-quiz:hover {
    background-color: #d89900;
}

.quiz-result {
    margin-top: 1rem;
    font-weight: bold;
}

/* Mise en page du quiz et de la colonne latérale */
.quiz-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.quiz-container {
    flex: 2;
    min-width: 300px;
}

.quiz-side {
    flex: 1;
    min-width: 260px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--card-shadow);
    padding: 1.5rem;
}

.quiz-side h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.quiz-side ul {
    list-style: disc inside;
}

.quiz-side li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Taille réduite pour les petits paragraphes */
.small {
    font-size: 0.85rem;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .quiz-wrapper {
        flex-direction: column;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #prix {
        height: 50vh;
    }
    #prix h2 {
        font-size: 1.5rem;
    }
    #prix .price {
        font-size: 2.3rem;
    }
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    header nav {
        margin-top: 0.5rem;
    }
    header nav a {
        margin-left: 0;
        margin-right: 1rem;
        margin-top: 0.3rem;
    }
    .cards {
        flex-direction: column;
    }
}