/* Variables CSS pour les thèmes */
:root {
  --primary-color: #007bff; /* Bleu standard */
  --primary-light: #66b3ff;
  --primary-dark: #0056b3;
  --text-color: #333;
  --background-color: #f8f9fa;
  --card-background: #ffffff;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --gradient-start: #007bff;
  --gradient-end: #00c6ff;
  --hover-effect: translateY(-3px);
  --transition-speed: 0.3s ease;
}

[data-theme="dark"] {
  --primary-color: #8c8cff; /* Bleu plus clair pour le mode sombre */
  --primary-light: #b3b3ff;
  --primary-dark: #5c5ca0;
  --text-color: #f0f0f0;
  --background-color: #1a1a2e;
  --card-background: #2e2e4a;
  --border-color: #4a4a6e;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --gradient-start: #4a00e0;
  --gradient-end: #8e2de2;
}

/* Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  scroll-behavior: smooth;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--primary-dark);
}

button {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
  transition: opacity var(--transition-speed);
}

button:hover {
  opacity: 0.8;
}

section {
  padding: 80px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Utilitaires */
.gradient-text {
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.highlight {
  font-weight: 600;
  color: var(--primary-color);
}

/* Boutons Généraux */
.btn-primary {
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  color: white;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
  transform: var(--hover-effect);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color var(--transition-speed), color var(--transition-speed), transform var(--transition-speed);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: var(--hover-effect);
}

.btn-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform var(--transition-speed), opacity var(--transition-speed);
}

.btn-product:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}


/* Navigation Bar */
.navbar {
  background-color: var(--card-background);
  box-shadow: 0 2px 10px var(--shadow-color);
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color var(--transition-speed);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.nav-brand i {
  font-size: 1.8rem;
  margin-right: 10px;
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  gap: 30px;
  align-items: center; /* Pour aligner le bouton de thème avec les liens */
}

.nav-menu a {
    color: var(--text-color);
}

.nav-link {
  font-weight: 500;
  padding: 10px 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-speed);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-toggle {
  display: none; /* Le bouton du menu hamburger est caché par défaut sur les grands écrans */
  font-size: 1.5rem;
  cursor: pointer;
}

.theme-toggle {
  font-size: 1.2rem;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Hero Section */
.hero-section {
  display: flex;
  align-items: center;
  gap: 50px;
  padding-top: 120px;
  padding-bottom: 120px;
  text-align: left;
}

.hero-content {
  flex: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--card-background);
  color: var(--text-color);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.hero-badge i {
  color: var(--primary-color);
  margin-right: 8px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-title .title-line {
  display: block;
}

.hero-greeting {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.floating-cards {
  position: relative;
  width: 300px;
  height: 300px;
}

.floating-card {
  position: absolute;
  background-color: var(--card-background);
  color: var(--primary-color);
  font-size: 2rem;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 15px;
  box-shadow: 0 5px 15px var(--shadow-color);
  animation: float-card 8s ease-in-out infinite;
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

/* Animations des cartes */
@keyframes float-card {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.card-1 { top: 0; left: 50%; animation-delay: 0s; }
.card-2 { top: 30%; right: 0; animation-delay: 1s; }
.card-3 { bottom: 0; right: 20%; animation-delay: 2s; }
.card-4 { bottom: 10%; left: 10%; animation-delay: 3s; }
.card-5 { top: 20%; left: 0; animation-delay: 4s; }
.card-6 { top: 70%; right: 40%; animation-delay: 5s; }

/* Sections communes */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  background-color: var(--card-background);
  color: var(--text-color);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.section-badge i {
  color: var(--primary-color);
  margin-right: 8px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.section-description {
  font-size: 1.1rem;
  color: #666;
  max-width: 700px;
  margin: 0 auto;
}

[data-theme="dark"] .section-description {
    color: #ccc;
}


/* Product Section */
.products-section {
  background-color: var(--background-color);
  transition: background-color var(--transition-speed);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.product-card {
  background-color: var(--card-background);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 5px 20px var(--shadow-color);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.product-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.product-content {
  flex-grow: 1;
  margin-bottom: 20px;
}

.product-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-color);
}

.product-description {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 15px;
}

[data-theme="dark"] .product-description {
    color: #ccc;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.feature-tag {
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: 500;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.stars {
  color: gold;
}

.stars i {
  font-size: 1rem;
}

.rating-text {
  font-size: 0.9rem;
  color: #888;
}

[data-theme="dark"] .rating-text {
    color: #bbb;
}

/* Filtres de produits */
.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 60px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed);
}

.filter-btn:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn.active i {
    color: white;
}

/* Barre de recherche */
.product-search-bar {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.product-search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    background-color: var(--card-background);
    color: var(--text-color);
    outline: none;
    transition: border-color var(--transition-speed);
}

.product-search-bar input:focus {
    border-color: var(--primary-color);
}

.product-search-bar button {
    margin-left: -40px;
    z-index: 10;
    font-size: 1.2rem;
    color: #aaa;
    transition: color var(--transition-speed);
}

.product-search-bar button:hover {
    color: var(--primary-color);
}

/* About Section */
.about-section {
  background-color: var(--card-background);
  transition: background-color var(--transition-speed);
}

.about-content {
  display: flex;
  gap: 50px;
  align-items: center;
  flex-direction: row-reverse;
}

.about-text {
  flex: 1;
}

.about-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-card {
  background-color: var(--background-color);
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 20px var(--shadow-color);
  transition: background-color var(--transition-speed);
}

.profile-avatar {
  font-size: 5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.profile-card h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.profile-card p {
  color: #888;
}

[data-theme="dark"] .profile-card p {
    color: #bbb;
}

.about-features {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.feature-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background-color: var(--card-background);
    padding: 60px 5%;
    border-top: 1px solid var(--border-color);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand {
    flex: 1;
    min-width: 250px;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-logo i {
    font-size: 2rem;
    margin-right: 10px;
    color: var(--primary-color);
}

.footer-description {
    font-size: 1rem;
    color: #888;
}

[data-theme="dark"] .footer-description {
    color: #bbb;
}

.footer-links {
    display: flex;
    gap: 50px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-column h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.footer-column a, .footer-column button {
    font-size: 1rem;
    color: #666;
    transition: color var(--transition-speed);
}

.footer-column a:hover, .footer-column button:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #aaa;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity var(--transition-speed), transform var(--transition-speed), visibility var(--transition-speed);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Media Queries pour le responsive design */
@media (max-width: 1024px) {
    .hero-section, .about-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        margin-bottom: 40px;
    }

    .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Cache le menu par défaut sur les petits écrans */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--card-background);
        padding: 20px 0;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .nav-menu.open {
        display: flex; /* Affiche le menu lorsque la classe 'open' est ajoutée */
    }

    .nav-link {
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-actions {
        gap: 20px;
    }

    .nav-toggle {
        display: block; /* Affiche le bouton du menu hamburger */
    }

    .theme-toggle {
        display: flex; /* Toujours afficher le bouton de thème */
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .product-search-bar {
        flex-direction: column;
        align-items: center;
    }

    .product-search-bar input {
        width: 100%;
        margin-bottom: 10px;
    }

    .product-search-bar button {
        margin-left: 0;
        position: static;
    }
}
