/* Variables globales */
:root {
  --ink: #2b1e17;
  --paper: #f6eee5;
  --chip: #fffdfa;
  --border: #e6ddd5;
  --accent: #b45309;
  --accent-ink: #1b110a;
  --category-dev: #8b5cf6;
  --category-design: #ec4899;
  --category-productivity: #10b981;
  --category-cloud: #06b6d4;
  --category-education: #f59e0b;
  --category-media: #ef4444;
}

/* Base */
html, body { 
  height: 100%; 
}

body { 
  font-family: 'Source Serif 4', Georgia, serif; 
  color: var(--ink); 
  background: var(--paper);
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(139, 92, 62, 0.03) 28px,
      rgba(139, 92, 62, 0.03) 29px
    );
}

/* Header */
.header-paper { 
  background: rgba(255,250,244,.92); 
  border-bottom: 1px solid var(--border); 
  backdrop-filter: saturate(150%) blur(8px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Boutons style Gumroad avec couleurs papier */
.btn-gumroad {
  position: relative;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: white;
  color: var(--ink);
  box-shadow: 4px 4px 0 0 var(--ink);
  transition: all 0.15s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-family: 'Fraunces', serif;
}

.btn-gumroad:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 var(--ink);
}

.btn-gumroad:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 var(--ink);
}

/* Variante primary */
.btn-gumroad-primary {
  background: var(--accent);
  color: white;
  border-color: var(--ink);
}

.btn-gumroad-primary:hover {
  background: var(--accent);
  opacity: 0.9;
}

/* Variante ghost */
.btn-gumroad-ghost {
  background: transparent;
  border-color: var(--border);
  box-shadow: 3px 3px 0 0 var(--border);
}

.btn-gumroad-ghost:hover {
  background: rgba(180, 83, 9, 0.05);
  box-shadow: 1px 1px 0 0 var(--border);
  border-color: var(--accent);
}

/* Bouton icône carré */
.btn-gumroad-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  gap: 0;
}

/* Petite taille */
.btn-gumroad-sm {
  padding: 8px 16px;
  font-size: 12px;
  box-shadow: 3px 3px 0 0 var(--ink);
}

.btn-gumroad-sm:hover {
  box-shadow: 1px 1px 0 0 var(--ink);
}

/* Grande taille */
.btn-gumroad-lg {
  padding: 16px 32px;
  font-size: 16px;
  box-shadow: 5px 5px 0 0 var(--ink);
}

.btn-gumroad-lg:hover {
  box-shadow: 3px 3px 0 0 var(--ink);
}

/* Bouton rond */
.btn-gumroad-round {
  border-radius: 50px;
}

/* Bouton avec icône */
.btn-gumroad i {
  margin-right: 8px;
}

/* Bouton désactivé */
.btn-gumroad:disabled,
.btn-gumroad[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  background: #f5f5f5 !important;
  color: #9ca3af !important;
  border-color: #d1d5db !important;
  box-shadow: 3px 3px 0 0 #d1d5db !important;
}

.btn-gumroad:disabled:hover,
.btn-gumroad[disabled]:hover {
  transform: none !important;
  box-shadow: 3px 3px 0 0 #d1d5db !important;
}

/* Category badges - Couleurs cool et modernes */
.badge-dev { background: rgba(139, 92, 246, 0.1); color: var(--category-dev); }
.badge-developpement { background: rgba(139, 92, 246, 0.1); color: var(--category-dev); }
.badge-design { background: rgba(236, 72, 153, 0.1); color: var(--category-design); }
.badge-productivity { background: rgba(16, 185, 129, 0.1); color: var(--category-productivity); }
.badge-productivite { background: rgba(16, 185, 129, 0.1); color: var(--category-productivity); }
.badge-cloud { background: rgba(6, 182, 212, 0.1); color: var(--category-cloud); }
.badge-education { background: rgba(245, 158, 11, 0.1); color: var(--category-education); }
.badge-media { background: rgba(239, 68, 68, 0.1); color: var(--category-media); }
.badge-default { background: rgba(107, 114, 128, 0.1); color: #6b7280; }

/* Language Switcher - Style pour Polylang */
.lang-item {
  display: inline-block;
}
.lang-item a,
.lang-item span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.lang-item a {
  color: #6b7280;
}
.lang-item a:hover {
  background: rgba(107, 114, 128, 0.1);
}
.lang-item.current-lang a,
.lang-item.current-lang span {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  font-weight: 600;
}

/* Navigation */
.nav-link {
  position: relative;
  font-family: 'Fraunces', 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--ink);
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: currentColor;
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* Cards */
.card {
  background: white;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 0 var(--ink);
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.card:not(.assistant-card):hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--accent);
}

/* Assistant card - Hover simple avec changement de bordure instantané */
.card.assistant-card,
.assistant-card {
  overflow: hidden !important;
  transition: none !important;
  transform: none !important;
}
.card.assistant-card::before,
.card.assistant-card::after,
.assistant-card::before,
.assistant-card::after {
  display: none !important;
  content: none !important;
}
.card.assistant-card:hover,
.assistant-card:hover {
  border-color: var(--accent) !important;
  transform: none !important;
  box-shadow: 4px 4px 0 0 var(--accent) !important;
  scale: none !important;
}
.card.assistant-card:hover::before,
.card.assistant-card:hover::after,
.assistant-card:hover::before,
.assistant-card:hover::after {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
}


/* Forms */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Fraunces', serif;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: white;
  font-size: 16px;
  transition: all 0.15s ease;
  box-shadow: 3px 3px 0 0 var(--ink);
}

.form-input:focus {
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--ink);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

/* Search container style Gumroad */
.search-gumroad {
  background: white;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 0 var(--ink);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  padding: 4px;
}

.search-gumroad:focus-within {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 0 var(--ink);
}

.search-gumroad input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  padding: 8px 12px;
  font-size: 16px;
}

/* Animations */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out forwards;
}

/* Hero sections */
.hero-section {
  padding: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(180, 83, 9, 0.03) 0%, transparent 70%);
  animation: float 20s infinite linear;
}

@keyframes float {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Container - Utilise les styles Tailwind, pas de max-width fixe */

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

/* Tooltip styles */
.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  margin-bottom: 8px;
}

.tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
  z-index: 10;
  pointer-events: none;
  margin-bottom: 2px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--paper);
  padding: 2rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 6px 6px 0 0 var(--ink);
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* StudApe text clamp - limite à 3 lignes avec ellipsis */
.studape-text-clamp {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

/* Line clamp utility pour limiter le texte sur plusieurs lignes */
.line-clamp-3 {
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.line-clamp-2 {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Responsive - Accessibilité pour les utilisateurs qui préfèrent moins d'animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  /* S'assurer que les éléments avec fade-in sont visibles */
  .fade-in,
  .slide-in-right {
    opacity: 1 !important;
    transform: none !important;
  }
}