/**
 * Lead Capture Modal - Custom Styling
 * Integrat cu tema site-ului (Baloo Chettan 2 + Open Sans)
 * Folosește variabilele CSS existente și stilul playful colorat
 */

/* Import font-uri dacă nu sunt deja încărcate */
@import url('https://fonts.googleapis.com/css2?family=Baloo+Chettan+2:wght@400;500;600;700&family=Open+Sans:wght@400;600;700&display=swap');

/* Overlay - Integrat cu tema site-ului */
.lcm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Același z-index ca modalul din site */
  padding: 1rem;
  opacity: 0;
  animation: lcm-fadeIn 0.3s ease-out forwards;
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, background 0.3s ease;
}

@media (max-width: 640px) {
  .lcm-overlay {
    padding: 0.5rem;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.lcm-overlay.lcm-closing {
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  background: rgba(0, 0, 0, 0);
}

@keyframes lcm-fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes lcm-slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes lcm-slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(50px);
    opacity: 0;
  }
}

@keyframes lcm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal Container - Folosește border-radius și shadow din tema site-ului */
.lcm-modal {
  background: white;
  border-radius: 20px; /* var(--radius) din site */
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  position: relative;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  animation: lcm-slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .lcm-modal {
    border-radius: 15px;
    max-height: none;
    margin: 0.5rem auto;
    width: calc(100vw - 1rem);
    max-width: 100%;
  }
}

.lcm-modal.lcm-closing {
  animation: lcm-slideDown 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.lcm-modal--small {
  max-width: 400px;
}

.lcm-modal--medium {
  max-width: 500px;
}

.lcm-modal--large {
  max-width: 650px;
}

/* Close Button - Adaptat la stilul site-ului */
.lcm-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 10;
  font-family: 'Baloo Chettan 2', cursive;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .lcm-close {
    top: 12px;
    right: 15px;
    font-size: 1.3rem;
  }
}

.lcm-close:hover {
  color: var(--theme-primary, #FF6B6B);
  transform: scale(1.1);
}

/* Content Container */
.lcm-content {
  padding: 40px;
}

@media (max-width: 640px) {
  .lcm-content {
    padding: 30px 20px;
  }
}

/* Header Section */
.lcm-header {
  text-align: center;
  margin-bottom: 30px;
}

@media (max-width: 640px) {
  .lcm-header {
    margin-bottom: 25px;
  }
}

/* Icon - Folosește gradient-ul tematic */
.lcm-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--theme-gradient, linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@media (max-width: 640px) {
  .lcm-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
  }
  
  .lcm-icon svg {
    width: 32px;
    height: 32px;
  }
}

/* Title - Folosește fontul Baloo Chettan 2 */
.lcm-title {
  font-family: 'Baloo Chettan 2', cursive;
  font-size: 2rem;
  font-weight: 600;
  color: var(--theme-primary, #FF6B6B);
  margin: 0 0 15px 0;
  line-height: 1.2;
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@media (max-width: 640px) {
  .lcm-title {
    font-size: 1.5rem;
  }
}

/* Subtitle - Folosește fontul Open Sans */
.lcm-subtitle {
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  color: #555;
  margin: 0;
  line-height: 1.6;
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@media (max-width: 640px) {
  .lcm-subtitle {
    font-size: 0.9rem;
  }
}

/* Form Styling */
.lcm-form {
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.lcm-form * {
  box-sizing: border-box;
}

.lcm-form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .lcm-form-grid-3 {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (max-width: 640px) {
  .lcm-form-grid-3 {
    gap: 12px;
  }
}

.lcm-form-group {
  margin-bottom: 0;
}

.lcm-form-group--full {
  grid-column: 1 / -1;
  margin-bottom: 15px;
}

/* Labels - Baloo Chettan 2 ca în site */
.lcm-label {
  display: block;
  font-family: 'Baloo Chettan 2', cursive;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

/* Inputs - Același stil ca în site */
.lcm-input {
  width: 100%;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  padding: 12px;
  border: 2px solid #eee;
  border-radius: 10px;
  background: white;
  color: #333;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .lcm-input {
    font-size: 16px; /* Previne zoom pe iOS */
    padding: 10px;
  }
}

.lcm-input::placeholder {
  color: #999;
}

.lcm-input:focus {
  outline: none;
  border-color: var(--theme-primary, #FF6B6B);
}

.lcm-input.lcm-input--error {
  border-color: #e74c3c !important;
}

/* Textarea */
.lcm-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'Open Sans', sans-serif;
  max-width: 100%;
}

/* Select Dropdown */
.lcm-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 35px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.lcm-select::-ms-expand {
  display: none;
}

/* Error Messages */
.lcm-error {
  display: block;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
  color: #e74c3c;
  margin-top: 5px;
  min-height: 1.2rem;
}

/* Action Buttons */
.lcm-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

@media (max-width: 640px) {
  .lcm-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }
}

.lcm-btn {
  font-family: 'Baloo Chettan 2', cursive;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 50px; /* Același ca în site */
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lcm-btn--primary {
  background: var(--theme-gradient, linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%));
  color: white;
  flex: 1;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.lcm-btn--primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.lcm-btn--primary:active:not(:disabled) {
  transform: translateY(-1px);
}

.lcm-btn--primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.lcm-btn--secondary {
  background: white;
  color: var(--theme-primary, #FF6B6B);
  border: 2px solid var(--theme-primary, #FF6B6B);
  flex: 1;
}

.lcm-btn--secondary:hover {
  background: #f9f9f9;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Spinner pentru loading */
.lcm-spinner {
  display: inline-flex;
  animation: lcm-spin 0.8s linear infinite;
}

/* Result Screen */
.lcm-result {
  text-align: center;
  padding: 20px 0;
}

.lcm-result-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lcm-result-icon--success {
  background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(78, 205, 196, 0.3);
}

.lcm-result-icon--error {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3);
}

.lcm-result-title {
  font-family: 'Baloo Chettan 2', cursive;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--theme-primary, #FF6B6B);
  margin: 0 0 15px 0;
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.lcm-result-message {
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  color: #555;
  margin: 0 0 25px 0;
  line-height: 1.6;
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.lcm-result-btn {
  animation: lcm-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
  max-width: 300px;
  margin: 0 auto;
}

/* Body no-scroll când modalul e deschis */
body.lcm-no-scroll {
  overflow: hidden;
  /* Nu mai folosim position: fixed pentru a evita jump-ul de content */
}

@media (max-width: 640px) {
  body.lcm-no-scroll {
    overflow: hidden;
    /* Pe mobile păstrăm simplu */
  }
}

/* Integrare cu variabilele CSS existente din site */
/* Acestea vor fi suprascrise automat dacă site-ul are tema Acting activată */
.lcm-overlay,
.lcm-modal,
.lcm-icon,
.lcm-title,
.lcm-btn--primary,
.lcm-btn--secondary,
.lcm-result-icon {
  /* Folosește variabilele CSS ale site-ului dacă sunt disponibile */
  --theme-primary: var(--primary-tv, #FF6B6B);
  --theme-gradient: var(--theme-gradient, linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%));
}

/* Support pentru tema Acting */
body[data-theme="acting"] .lcm-icon,
body[data-theme="acting"] .lcm-title,
body[data-theme="acting"] .lcm-btn--primary,
#page-acting.active-page .lcm-icon,
#page-acting.active-page .lcm-title,
#page-acting.active-page .lcm-btn--primary {
  --theme-primary: #4ECDC4;
  --theme-gradient: linear-gradient(135deg, #4ECDC4 0%, #556270 100%);
}
