/* Basic Reset & Global Styles */
:root {
  --color-primary-text: #ffffff;
  --color-secondary-text: #e0e0e0;
  --color-tertiary-text: #a0a0a0;
  --color-card-bg: rgba(255, 255, 255, 0.1);
  --color-card-border: rgba(255, 255, 255, 0.2);
  --color-input-bg: rgba(255, 255, 255, 0.2);
  --color-input-border: rgba(255, 255, 255, 0.3);
  --color-button-bg: #ffffff;
  --color-button-text: #000000;
  --color-button-hover: #e0e0e0;
  --color-black-overlay: rgba(0, 0, 0, 0.6);
  --color-black-gradient-start: rgba(0, 0, 0, 0.7);
  --color-black-gradient-mid: rgba(0, 0, 0, 0.6);
  --color-black-gradient-end: rgba(0, 0, 0, 0.8);
  --color-success: #10b981;
  --color-error: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: #000000;
  color: var(--color-primary-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

.site-container {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Grid */
.background-grid {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 4px; /* Smaller gap for mobile */
  padding: 8px; /* Smaller padding for mobile */
  z-index: 0;
}

.background-grid-item {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.background-grid-item.loaded {
  opacity: 0.1; /* Very subtle opacity for the grid */
  transform: scale(1);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--color-black-gradient-start),
    var(--color-black-gradient-mid),
    var(--color-black-gradient-end)
  );
  backdrop-filter: blur(1px);
  z-index: 1;
}

/* Main Content Wrapper */
.main-content-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease-out 0.7s, transform 1s ease-out 0.7s; /* Delay for content fade-in */
}

.main-content-wrapper.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* NEW HERO SECTION */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 20px;
  background-image: url("./images/profile/hero-main.jpg"); /* Imagem padrão para mobile */
  background-size: cover;
  background-position: center; /* Ajuste a posição se necessário para mobile */
  background-repeat: no-repeat;
  color: var(--color-primary-text);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  transition: opacity 1s ease-out;
  opacity: 0;
}

.hero-section.loaded {
  opacity: 1;
}

.instagram-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--color-primary-text);
  z-index: 11; /* Above hero content */
  transition: transform 0.3s ease;
}

.instagram-icon:hover {
  transform: scale(1.1);
}

.instagram-icon svg {
  width: 30px;
  height: 30px;
}

.hero-text-content {
  position: relative; /* To be above the hero background image */
  z-index: 10;
  margin-bottom: 80px; /* Space from bottom of viewport */
  padding-left: 10px; /* Small indent from left edge */
}

.hero-name {
  font-size: 3.5rem; /* Large font for name */
  font-weight: bold;
  line-height: 1;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hero-portfolio {
  font-size: 1.8rem;
  font-weight: normal;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero-measurements p {
  font-size: 1.2rem;
  line-height: 1.4;
  margin-bottom: 5px;
}

/* Main Content Grid */
.main-content {
  flex: 1;
  width: 100%; /* Ensure it takes full available width */
  max-width: 1024px; /* max-w-7xl */
  margin: 0 auto;
  padding: 0 16px 32px; /* px-4 pb-8 */
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 32px; /* gap-8 */
  align-items: flex-start;
  padding-top: 40px; /* Space after hero section */
}

/* Card Styles */
.card {
  background-color: var(--color-card-bg);
  backdrop-filter: blur(16px); /* backdrop-blur-lg */
  border: 1px solid var(--color-card-border);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-2xl */
  border-radius: 0.5rem; /* rounded-lg */
  transition: all 1s ease-out;
}

/* Removido info-card, então apenas contact-card precisa de transição */
/* .info-card {
  transition-delay: 0.3s;
  transform: translateX(-32px);
  opacity: 0;
} */

.contact-card {
  transition-delay: 0.5s;
  transform: translateX(32px);
  opacity: 0;
}

/* Ajustado para que contact-card seja o único a carregar */
/* .info-card.loaded, */
.contact-card.loaded {
  opacity: 1;
  transform: translateX(0);
}

.card-content {
  padding: 24px; /* p-6 */
}

.card-title {
  font-size: 1.5rem; /* text-2xl */
  font-weight: bold;
  color: var(--color-primary-text);
  margin-bottom: 24px; /* mb-6 */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* gap-2 */
}

.card-title svg {
  width: 24px; /* w-6 */
  height: 24px; /* h-6 */
}

/* Measurements Grid (removido, mas mantendo as classes para evitar erros) */
.measurements-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 16px; /* gap-4 */
  color: var(--color-primary-text);
}

.measurement-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.measurement-item {
  background-color: rgba(255, 255, 255, 0.05); /* bg-white/5 */
  padding: 12px; /* p-3 */
  border-radius: 8px; /* rounded-lg */
}

.measurement-item .label {
  color: var(--color-tertiary-text);
  font-size: 0.875rem; /* text-sm */
  display: block;
}

.measurement-item .value {
  font-size: 1.25rem; /* text-xl */
  font-weight: bold;
}

.measurement-footer {
  margin-top: 24px; /* mt-6 */
  padding-top: 24px; /* pt-6 */
  border-top: 1px solid var(--color-card-border);
}

.measurement-footer .measurement-item.center {
  text-align: center;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px; /* space-y-4 */
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px; /* px-3 py-2 */
  background-color: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: 0.375rem; /* rounded-md */
  color: var(--color-primary-text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, background-color 0.3s;
}

.form-group input.error,
.form-group textarea.error {
  border-color: var(--color-error);
  background-color: rgba(239, 68, 68, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-tertiary-text);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(255, 255, 255, 0.5); /* focus:border-white/50 */
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2); /* focus:ring-white/20 */
}

.form-group textarea {
  min-height: 120px; /* min-h-[120px] */
  resize: vertical;
}

.error-text {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: 4px;
  display: block;
}

.submit-button {
  width: 100%;
  background-color: var(--color-button-bg);
  color: var(--color-button-text);
  font-weight: 600; /* font-semibold */
  padding: 12px 16px; /* py-3 */
  border: none;
  border-radius: 0.375rem; /* rounded-md */
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px; /* mr-2 */
  transition: background-color 0.3s, transform 0.3s;
  position: relative;
}

.submit-button:hover:not(:disabled) {
  background-color: var(--color-button-hover);
  transform: scale(1.02); /* hover:scale-105 */
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.submit-button svg {
  width: 16px; /* w-4 */
  height: 16px; /* h-4 */
}

/* Success and Error Messages (removido, mas mantendo as classes para evitar erros) */
.success-message,
.error-message {
  padding: 16px;
  border-radius: 0.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
}

.success-message {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}

.error-message {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

.success-message svg,
.error-message svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-email-direct {
  margin-top: 24px; /* mt-6 */
  padding-top: 24px; /* pt-6 */
  border-top: 1px solid var(--color-card-border);
  text-align: center;
}

.email-link {
  color: var(--color-primary-text);
  text-decoration: none;
  transition: color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* gap-2 */
  background-color: rgba(255, 255, 255, 0.1);
  padding: 8px 16px; /* py-2 px-4 */
  border-radius: 9999px; /* rounded-full */
  transition: background-color 0.3s;
}

.email-link:hover {
  color: var(--color-secondary-text);
  background-color: rgba(255, 255, 255, 0.2);
}

.email-link svg {
  width: 16px; /* w-4 */
  height: 16px; /* h-4 */
}

/* Photo Gallery Section */
.photo-gallery-section {
  margin-top: 48px; /* mt-12 */
  padding-bottom: 32px; /* pb-8 */
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease-out 0.9s, transform 1s ease-out 0.9s; /* Delay for gallery fade-in */
}

.photo-gallery-section.loaded {
  opacity: 1;
  transform: translateY(0);
}

.gallery-title {
  font-size: 2rem; /* text-3xl */
  font-weight: bold;
  color: var(--color-primary-text);
  margin-bottom: 24px; /* mb-6 */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* gap-2 */
}

.gallery-title svg {
  width: 24px; /* w-6 */
  height: 24px; /* h-6 */
}

.gallery-container {
  display: flex;
  overflow-x: auto; /* Enable horizontal scrolling */
  scroll-snap-type: x mandatory; /* Snap to items */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  gap: 16px; /* gap-4 */
  padding-bottom: 16px; /* Add some padding for scrollbar */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent; /* Firefox */
}

/* Custom scrollbar for Webkit browsers */
.gallery-container::-webkit-scrollbar {
  height: 8px;
}

.gallery-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.gallery-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.gallery-item {
  flex-shrink: 0; /* Prevent items from shrinking */
  width: 80vw; /* Take 80% of viewport width on mobile */
  max-width: 400px; /* Max width for desktop */
  height: 300px; /* Fixed height for consistency */
  border-radius: 0.5rem; /* rounded-lg */
  overflow: hidden;
  scroll-snap-align: center; /* Snap to center of item */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-md */
  transition: transform 0.3s ease-in-out;
}

.gallery-item:hover {
  transform: scale(1.03);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover the area, crop if necessary */
  display: block;
}

/* Footer Section */
.footer-section {
  margin-top: auto;
  text-align: center;
  padding: 24px 16px; /* py-6 px-4 */
  border-top: 1px solid var(--color-card-border);
  background-color: rgba(0, 0, 0, 0.3); /* bg-black/30 */
  backdrop-filter: blur(4px); /* backdrop-blur-sm */
  transition: all 1s ease-out 0.7s;
  opacity: 0;
  transform: translateY(30px);
}

.footer-section.loaded {
  opacity: 1;
  transform: translateY(0);
}

.footer-content {
  max-width: 960px; /* max-w-4xl */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px; /* space-y-4 */
}

.footer-item {
  display: flex;
  flex-direction: column; /* Stack on mobile */
  align-items: center;
  justify-content: center;
  gap: 8px; /* gap-2 */
  color: var(--color-tertiary-text);
}

.footer-item svg {
  width: 16px; /* w-4 */
  height: 16px; /* h-4 */
}

.copyright {
  font-size: 0.875rem; /* text-sm */
  color: var(--color-tertiary-text);
  padding-top: 16px; /* pt-4 */
  border-top: 1px solid rgba(255, 255, 255, 0.1); /* border-white/10 */
}

/* Media Queries for Responsiveness */
@media (min-width: 768px) {
  /* md breakpoint */
  .background-grid {
    gap: 4px; /* md:gap-4 */
    padding: 16px; /* md:p-4 */
  }

  .hero-section {
    padding: 40px; /* More padding on larger screens */
    background-image: url("./images/profile/hero-main-desktop.jpg"); /* Imagem para desktop */
    background-position: center center; /* Ajuste a posição para desktop */
  }

  .instagram-icon {
    top: 40px;
    left: 40px;
  }

  .instagram-icon svg {
    width: 36px;
    height: 36px;
  }

  .hero-text-content {
    margin-bottom: 100px; /* More space from bottom */
    padding-left: 20px;
  }

  .hero-name {
    font-size: 5rem; /* Larger font for name */
  }

  .hero-portfolio {
    font-size: 2.5rem;
  }

  .hero-measurements p {
    font-size: 1.3rem;
  }

  .card-content {
    padding: 32px; /* md:p-8 */
  }

  .card-title {
    font-size: 1.875rem; /* md:text-3xl */
  }

  /* Removido measurements-grid, mas mantendo as classes para evitar erros */
  .measurements-grid {
    grid-template-columns: repeat(2, 1fr); /* Two columns on desktop */
    gap: 24px; /* md:gap-6 */
  }

  .measurement-item .value {
    font-size: 1.5rem; /* md:text-2xl */
  }

  .footer-content {
    flex-direction: row; /* md:flex-row */
    gap: 32px; /* md:gap-8 */
  }

  .footer-item {
    flex-direction: row; /* md:flex-row */
  }

  .gallery-item {
    width: 300px; /* Fixed width for desktop */
  }

  /* NOVO: Ajuste para centralizar o formulário de contato no desktop */
  .info-grid {
    grid-template-columns: 1fr; /* Força uma única coluna */
    justify-items: center; /* Centraliza o item dentro da coluna */
  }
}

@media (min-width: 1024px) {
  /* lg breakpoint */
  /* NOVO: Ajuste para centralizar o formulário de contato em telas maiores */
  .info-grid {
    grid-template-columns: 1fr; /* Força uma única coluna */
    justify-items: center; /* Centraliza o item dentro da coluna */
    gap: 48px; /* lg:gap-12 */
  }

  .hero-name {
    font-size: 6rem; /* Even larger font for name */
  }

  .hero-portfolio {
    font-size: 3rem;
  }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .background-grid-item,
  .main-content-wrapper,
  /* .info-card, */ /* Removido */ .contact-card,
  .footer-section,
  .submit-button,
  .photo-gallery-section,
  .gallery-item,
  .hero-section {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
