/* --- Reset & Fundamente --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  scroll-behavior: smooth;
}

:root {
  --bg-color: #0d0e12;
  --card-bg: #161820;
  --accent: #6366f1; /* Indigo modern */
  --accent-hover: #4f46e5;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --error: #ef4444;
  --success: #10b981;
  --border: #27272a;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
}

/* --- Navigație --- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 10%;
  position: fixed;
  width: 100%;
  top: 0;
  background: rgba(13, 14, 18, 0.8);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  margin-top: -13px;
  margin-bottom: -13px;
}

.logo img {
  height: 80px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -6px;
  left: 0;
  background-color: var(--text-main);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease-out;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.lang-selector button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.3s;
}

.lang-selector button.active,
.lang-selector button:hover {
  background: var(--text-main);
  color: var(--bg-color);
  border-color: var(--text-main);
}

/* --- Secțiunea Hero (Home) --- */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

/* Butoane globale */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition:
    background 0.3s,
    transform 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hidden {
  display: none !important;
}

/* --- Portofoliu Dinamic --- */
#portfolio,
#simulator {
  padding: 6rem 10% 2rem 10%;
}

h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* --- GRID OPTIMIZAT --- */
.portfolio-grid {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

.portfolio-grid.active-grid {
  opacity: 1;
  visibility: visible;
  position: relative;
  pointer-events: auto;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

/* Modul cel mai rapid de ascundere pentru browser */
.portfolio-item.hidden {
  display: none !important;
}

.portfolio-item {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  height: 260px; /* Înlocuit aspect-ratio cu înălțime fixă pentru viteză */
  transition: transform 0.2s ease-out;
  transform: translate3d(0, 0, 0); /* Forțează randarea prin placa video */
  backface-visibility: hidden;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 14, 18, 0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  padding: 2rem;
  text-align: center;
}

.portfolio-item:hover .item-overlay {
  opacity: 1;
}

.portfolio-item:hover {
  transform: translateY(-4px);
}

/* --- SLIDER CORECTAT ȘI MULT MAI LENT --- */
.portfolio-slider {
  width: 100%;
  overflow: hidden;
  position: relative;
  display: none;
  margin-top: 2rem;
}

.portfolio-slider.active-slider {
  display: block;
}

.slider-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: infiniteScroll 140s linear infinite; /* 140 de secunde - mult mai lent */
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.slide {
  width: 380px;
  height: 260px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes infiniteScroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-50% - 1rem), 0, 0);
  }
}

/* --- MODAL / LIGHTBOX LIGHTWEIGHT --- */
.modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
  /* Am scos backdrop-filter: blur deoarece distruge performanța pe ecrane mari */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  visibility: hidden;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  border: 3px solid #fff;
  /* Am scos animația complexă de zoomIn și umbrele grele */
}
/* Legenda (Caption) sub imagine */
#caption-modal {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 15px 0;
  font-size: 1.1rem;
}

/* Butonul de închidere (X) */
.close-modal {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 2001;
}

.close-modal:hover,
.close-modal:focus {
  color: var(--accent); /* Culoarea de accent a site-ului tău la hover */
  text-decoration: none;
}

/* Ajustări pentru ecrane mici (mobile) */
@media only screen and (max-width: 700px) {
  .modal-content {
    width: 95%;
  }
  .close-modal {
    right: 20px;
    top: 10px;
  }
}

/* --- Simulator (Brief pe Pași) --- */
/* =========================================================================
   1. STRUCTURĂ ȘI CONTAINER SIMULATOR
   ========================================================================= */
.simulator-container {
  max-width: 700px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem;
}

/* --- Indicator Pași (Cercuri) --- */
.steps-indicator {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.step-dot {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s;
}

.step-dot.active {
  border-color: var(--accent);
  color: var(--text-main);
  background: var(--accent);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

/* --- Management Pași (Afișare/Ascundere) --- */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-step h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 400;
}

/* =========================================================================
   2. GRILĂ OPTIUNI ȘI CARDURI INTERACTIVE
   ========================================================================= */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.option-card {
  position: relative;
  cursor: pointer;
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.card-content {
  background: var(--bg-color);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.3s;
}

/* Stare: Card Selectat (Radio Checked) */
.option-card input[type="radio"]:checked + .card-content {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.03);
}

.card-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* =========================================================================
   3. NOU: STILIZARE IMAGINI REALE (PASUL 1)
   ========================================================================= */
.image-style-card {
  padding: 0 !important; /* Elimină padding-ul global pentru a lăsa imaginea să atingă marginile */
  display: flex;
  flex-direction: column; /* Așează elementele pe verticală: imaginea sus, textul jos */
  justify-content: flex-start;
  align-items: stretch;
  overflow: hidden; /* Asigură că colțurile generale ale cardului rămân rotunjite */
}

/* Fereastra imaginii (se taie la colțurile de sus ale cardului) */
.card-image-wrapper {
  height: 160px; /* Înălțimea zonei foto (o poți ajusta după bunul plac) */
  overflow: hidden; /* Taie imaginea dacă e mai mare */
  position: relative;
  border-bottom: 1px solid var(--border); /* O linie fină de separare între imagine și text (Opțional) */
}

.design-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Umple toată zona ferestrei și taie marginile proporțional */
  transition: transform 0.5s ease;
  display: block;
}

/* Zona de text de sub imagine */
.card-text-wrapper {
  padding: 1.2rem 1rem; /* Spațiul din jurul textului din interiorul cardului */
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Titlul stilului (ex: Wordmark, Badge) */
.preview-text-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Descrierea subtilă de sub titlu */
.card-text-wrapper p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Efect de Zoom doar pe imagine la selecție --- */
.option-card
  input[type="radio"]:checked
  + .image-style-card
  .design-preview-image {
  transform: scale(1.08); /* Doar imaginea face zoom, textul rămâne nemișcat */
}

/* =========================================================================
   4. PREVIZUALIZĂRI TIPOGRAFIE (PASUL 2)
   ========================================================================= */
.preview-text {
  font-size: 1.5rem;
  font-weight: bold;
}
.font-sans {
  font-family: "Inter", sans-serif;
  font-weight: 300;
}
.font-serif {
  font-family: "Playfair Display", serif;
}
.font-script {
  font-family: "Pacifico", cursive;
  font-size: 1.3rem;
}

/* =========================================================================
   5. PREVIZUALIZĂRI CULORI (PASUL 3)
   ========================================================================= */
.color-preview-bar {
  display: flex;
  gap: 0.5rem;
}
.color-preview-bar span {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
/* CSS pentru a gestiona cele 3 coloane la pasul de culori */
.colors-grid {
  grid-template-columns: 1fr 1fr 1fr; /* Creează 3 coloane egale */
}

/* Opțional: Ajustare pentru ecrane mici/telefoane ca să nu se înghesuie cercurile */
@media (max-width: 568px) {
  .colors-grid {
    grid-template-columns: 1fr; /* Pe telefon se vor așeza una sub alta, curat */
  }
}

.btn-example {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 0.6rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-example:hover {
  border-color: var(--accent);
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.05);
}

/* =========================================================================
   6. FORMULAR CONTACT, INPUTURI & ERORI (PASUL 4)
   ========================================================================= */
.input-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.input-group textarea,
.input-group input[type="email"] {
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.input-group textarea:focus,
.input-group input[type="email"]:focus {
  border-color: var(--accent);
}

/* --- Zona Drag & Drop File --- */
.file-drop-zone {
  border: 2px dashed var(--border);
  background: var(--bg-color);
  padding: 2rem;
  text-align: center;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: border-color 0.3s;
}

.file-drop-zone:hover {
  border-color: var(--accent);
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-zone p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Mesaje de eroare --- */
.error-msg {
  color: var(--error);
  font-size: 0.8rem;
  height: 1rem;
}

/* =========================================================================
   7. BUTOANE DE NAVIGARE SIMULATOR
   ========================================================================= */
.simulator-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

.hidden {
  display: none !important;
}

/* --- Secțiunea Contact --- */
#contact {
  padding: 6rem 10% 4rem 10%;
  background-color: var(--bg-color);
}

.contact-container {
  display: flex;
  gap: 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.contact-info,
.contact-form-wrapper {
  flex: 1;
}

.contact-info h3 {
  font-size: 1.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.info-links {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.info-icon {
  font-size: 1.5rem;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.info-item h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.info-item a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.3s;
}

.info-item a:hover {
  color: var(--accent);
}

.contact-form-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
}

/* Reutilizare input-group existent în stiluri */
.contact-form-wrapper input[type="text"],
.contact-form-wrapper input[type="email"],
.contact-form-wrapper textarea {
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
  width: 100%;
}

.contact-form-wrapper input:focus,
.contact-form-wrapper textarea:focus {
  border-color: var(--accent);
}

/* Ajustare pentru ecrane mici (Mobile) */
@media (max-width: 768px) {
  .contact-container {
    flex-direction: column;
    gap: 2.5rem;
  }
  #contact {
    padding: 4rem 5%;
  }
  .contact-form-wrapper {
    padding: 1.5rem;
  }
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 6rem;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  } /* Pentru un proiect universitar simplificăm pe mobile */
  .hero-content h1 {
    font-size: 2.3rem;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .simulator-container {
    padding: 1.5rem;
  }
}
