/**
 * Custom styles for "Créations Visuelles" landing page
 * Includes animations, transitions, and responsive tweaks
 */

/* ========================================================================== */
/* IMAGE PREVIEW GALLERY */
/* ========================================================================== */

#imagePreviewContainer {
  background: #f9f8f7;
  border-radius: 8px;
  margin-top: 20px;
  padding: 1rem;
}

@media (max-width: 768px) {
  #imagePreviewContainer {
    padding: 0.75rem;
    margin-top: 15px;
  }
}

#imagePreviewGrid {
  display: grid;
}

/* Responsive grid items with animations */
#imagePreviewGrid > div {
  animation: fadeIn 0.3s ease-in-out;
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  border: 1px solid #e6e0db;
}

#imagePreviewGrid > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Image styling responsive */
#imagePreviewGrid img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  display: block;
}

@media (max-width: 480px) {
  #imagePreviewGrid img {
    height: 100px;
  }
}

/* Delete button visibility on hover */
#imagePreviewGrid button {
  opacity: 0;
  transition: opacity 0.2s ease;
  background-color: rgba(236, 109, 19, 0.9);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 1.25rem;
  cursor: pointer;
  position: absolute;
  bottom: 8px;
  right: 8px;
}

#imagePreviewGrid > div:hover button {
  opacity: 1;
}

#imagePreviewGrid button:hover {
  background-color: #ec6d13;
  transform: scale(1.1);
}

/* ========================================================================== */
/* ANIMATIONS */
/* ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================================================== */
/* GENERAL STYLES */
/* ========================================================================== */

:root {
  --primary-color: #ec6d13;
  --dark-text: #181411;
  --light-text: #897261;
  --border-color: #e6e0db;
  --bg-white: #ffffff;
  --transition-default: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  transition: var(--transition-default);
}

/* ========================================================================== */
/* HEADER */
/* ========================================================================== */

header {
  animation: slideInLeft 0.6s ease-out;
  /* Responsive padding: moins d'espace sur mobile */
  padding: 1rem 1rem;
}

@media (min-width: 480px) {
  header {
    padding: 0.75rem 2.5rem;
  }
}

@media (min-width: 768px) {
  header {
    padding: 0.75rem 2.5rem;
  }
}

header svg {
  transition: transform 0.3s ease;
}

header:hover svg {
  transform: rotate(10deg) scale(1.05);
}

/* Logo size responsive */
header .size-5 {
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 480px) {
  header .size-5 {
    width: 1rem;
    height: 1rem;
  }
}

/* Brand title responsive */
header h2 {
  font-size: 1.125rem;
}

@media (max-width: 480px) {
  header h2 {
    font-size: 1rem;
  }
}

/* ========================================================================== */
/* HERO SECTION */
/* ========================================================================== */

.hero-section {
  animation: fadeIn 0.8s ease-out;
  position: relative;
  /* Hauteur responsive */
  min-height: 480px;
}

h1{
    text-align: center;
    max-width: 100%;
}
p{
  text-align: center;
  max-width: 100%;
}

@media (max-width: 768px) {
  .hero-section {
    min-height: 420px;
  }
}

@media (max-width: 480px) {
  .hero-section {
    min-height: 380px;
    padding: 1rem;
  }
}

/* Grand écran: réduire la hauteur pour que le texte soit plus visible */
@media (min-width: 1024px) {
  .hero-section {
    min-height: 380px;
  }
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(236, 109, 19, 0.1) 0%,
    rgba(24, 20, 17, 0.1) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Responsive gap dans la section hero */
.hero-section {
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .hero-section {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    gap: 0.75rem;
  }
}

/* Responsive title sizing */
.hero-section h1 {
  font-size: 2.25rem;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 1.5rem;
    line-height: 1.15;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.125rem;
    line-height: 1.1;
    font-weight: 800;
  }
  h1{
    text-align: center;
    max-width: 90%;
  }
  h2{
    text-align: center;
    max-width: 90%;
  }
  h3{
    text-align: center;
    max-width: 90%;
  }
}

/* Responsive subtitle sizing */
.hero-section h2 {
  font-size: 0.875rem;
  line-height: 1.4;
  /* Centre le texte et limite la largeur */
  text-align: center;
  max-width: 100%;
}

@media (max-width: 768px) {
  .hero-section h2 {
    font-size: 0.75rem;
    line-height: 1.3;
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .hero-section h2 {
    font-size: 0.65rem;
    line-height: 1.2;
    max-width: 95%;
  }
}

/* ========================================================================== */
/* EMAIL FORM */
/* ========================================================================== */

/* Form container responsive */
.email-form {
  transition: var(--transition-default);
  border-radius: 8px;
}

@media (max-width: 480px) {
  .email-form {
    flex-direction: column;
    min-height: auto;
  }
}

/* Input styling responsive */
.email-form input {
  transition: var(--transition-default);
  border: 2px solid transparent;
  font-size: 0.875rem;
}

@media (min-width: 480px) {
  .email-form input {
    font-size: 0.875rem;
  }
}

.email-form input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(236, 109, 19, 0.1);
  border-radius: 10px;
}

/* Input placeholder responsive */
.email-form input::placeholder {
  font-size: 0.75rem;
}

@media (min-width: 480px) {
  .email-form input::placeholder {
    font-size: 0.875rem;
  }
}

/* Button styling responsive */
.email-form button {
  transition: var(--transition-default);
  position: relative;
  overflow: hidden;
  font-size: 0.75rem;
}

@media (min-width: 480px) {
  .email-form button {
    font-size: 0.875rem;
  }
}

.email-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

.email-form button:hover::before {
  left: 100%;
}

.email-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(236, 109, 19, 0.3);
}

.email-form button:active {
  transform: translateY(0);
}

/* ========================================================================== */
/* UPLOAD AREA */
/* ========================================================================== */

.upload-drop-zone {
  transition: var(--transition-default);
  cursor: pointer;
  position: relative;
  /* Padding responsive */
  padding: 1rem;
}

@media (min-width: 480px) {
  .upload-drop-zone {
    padding: 1rem;
  }
}

/* Drop zone inner container responsive */
.upload-drop-zone > div {
  padding: 2rem 1.5rem;
}

@media (min-width: 480px) {
  .upload-drop-zone > div {
    padding: 3.5rem 1.5rem;
  }
}

@media (min-width: 768px) {
  .upload-drop-zone > div {
    padding: 3.5rem 1.5rem;
  }
}

.upload-drop-zone.drag-over {
  background-color: rgba(236, 109, 19, 0.05);
  border-color: var(--primary-color) !important;
  transform: scale(1.02);
}

/* Responsive button in upload zone */
.upload-drop-zone button {
  transition: var(--transition-default);
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  .upload-drop-zone button {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }
}

.upload-drop-zone:hover button {
  background-color: #e6e0db;
  transform: translateY(-2px);
}

.upload-drop-zone button:active {
  transform: translateY(0);
}

/* Upload zone text responsive */
.upload-drop-zone p {
  font-size: 1rem;
}

@media (max-width: 480px) {
  .upload-drop-zone p {
    font-size: 0.875rem;
  }
}

#fileInput {
  display: none;
}

/* ========================================================================== */
/* FEATURE CARDS */
/* ========================================================================== */

.feature-card {
  animation: scaleIn 0.5s ease-out;
  transition: var(--transition-default);
  /* Padding responsive */
  padding: 1rem;
}

@media (max-width: 480px) {
  .feature-card {
    padding: 0.75rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(24, 20, 17, 0.1);
  border-color: var(--primary-color);
}

/* Feature card icon responsive */
.feature-card svg {
  transition: transform 0.3s ease;
  width: 24px;
  height: 24px;
}

@media (max-width: 480px) {
  .feature-card svg {
    width: 20px;
    height: 20px;
  }
}

.feature-card:hover svg {
  transform: scale(1.15) rotate(5deg);
  color: var(--primary-color);
}

/* Feature card title responsive */
.feature-card h2 {
  font-size: 1rem;
}

@media (max-width: 480px) {
  .feature-card h2 {
    font-size: 0.875rem;
  }
}

/* ========================================================================== */
/* FOOTER */
/* ========================================================================== */

footer {
  animation: slideInLeft 0.8s ease-out 0.2s both;
  /* Padding responsive */
  padding: 2rem 1rem;
}

@media (min-width: 480px) {
  footer {
    padding: 2.5rem 1.25rem;
  }
}

@media (min-width: 768px) {
  footer {
    padding: 2.5rem 1.25rem;
  }
}

/* Footer links responsive */
footer a {
  transition: var(--transition-default);
  position: relative;
  font-size: 0.875rem;
  width: fit-content;
}

@media (max-width: 480px) {
  footer a {
    font-size: 0.75rem;
    width: 120px;
  }
}

footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

footer a:hover::after {
  width: 100%;
}

/* Social icons responsive */
footer svg {
  transition: transform 0.3s ease, color 0.3s ease;
  width: 24px;
  height: 24px;
}

@media (max-width: 480px) {
  footer svg {
    width: 20px;
    height: 20px;
  }
}

footer a:hover svg {
  transform: scale(1.2) rotate(5deg);
  color: var(--primary-color);
}

/* Ensure footer links are properly aligned horizontally */
footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}

/* Footer text responsive */
footer p {
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  footer p {
    font-size: 0.75rem;
  }
}

/* ========================================================================== */
/* RESPONSIVE ADJUSTMENTS */
/* ========================================================================== */

/* Container principal responsive */
.image-principale {
  /* Padding horizontal responsive */
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 480px) {
  .image-principale {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

@media (min-width: 768px) {
  .image-principale {
    padding-left: 7rem;
    padding-right: 7rem;
  }
}

@media (min-width: 1024px) {
  .image-principale {
    padding-left: 7rem;
    padding-right: 7rem;
  }
}

/* Tablette: hauteur héros réduite */
@media (max-width: 768px) {
  .hero-section {
    min-height: 380px;
  }
}

/* Mobile: hauteur héros très réduite */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .hero-section {
    min-height: 300px;
    padding: 1rem;
  }

  /* Validation messages responsive */
  .valid-Mail,
  .valid-success {
    max-width: 100%;
    padding: 0.75rem;
  }

  /* Feature cards grid responsive */
  .grid.grid-cols-\[repeat\(auto-fit\,minmax\(158px\,1fr\)\)\] {
    grid-template-columns: 1fr;
  }
}

/* Petit écran: tablette horizontale */
@media (min-width: 481px) and (max-width: 768px) {
  .upload-drop-zone > div {
    padding: 2.5rem 1.5rem;
  }
}

/* ========================================================================== */
/* UTILITIES */
/* ========================================================================== */

.smooth-transition {
  transition: var(--transition-default);
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.scale-in {
  animation: scaleIn 0.5s ease-out;
}

.pulse-animation {
  animation: pulse 2s infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
