/**
 * Vincenzo Falace - Showcase Website
 * File: assets/css/components.css
 * Description: Shared components styling including glassmorphism cards, buttons, footer, form elements, scrollbars, and modals.
 */

/* ==========================================
   1. CUSTOM SCROLLBARS
   ========================================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--bg);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: hsla(var(--accent-tech-hsl), 0.5);
}

/* ==========================================
   2. GLASSMORPHISM CARDS
   ========================================== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.04), transparent 40%);
  pointer-events: none;
  z-index: 1;
}

/* Card Hover States */
.card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border-highlight);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--glass-border-highlight);
}

/* Tech-focused card styling */
.card-tech {
  border-left: 2px solid var(--accent-tech);
}

.card-tech:hover {
  border-color: rgba(228, 200, 165, 0.4);
  box-shadow: var(--shadow-lg), var(--glow-tech);
}

/* Sales-focused card styling */
.card-sale {
  border-left: 2px solid var(--accent-sale);
}

.card-sale:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-lg), var(--glow-sale);
}

/* Elevate Class for Card Depth */
.card-elevated {
  background: var(--glass-bg-elevated);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h4);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.card-body {
  color: var(--text-secondary);
}

/* ==========================================
   3. BUTTONS & CTAs (Executive Atelier Style)
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

/* Primary Button: Pure Crisp Platinum White (High Contrast) */
.btn-primary {
  background: #FFFFFF !important;
  color: #080A0D !important;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: #EAEAE6 !important;
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.28);
}

/* Secondary Button: Subtle Titanium Outline */
.btn-secondary {
  background: transparent !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Glass-style Button */
.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border-highlight);
}

/* Button Sizes */
.btn-lg {
  padding: 1.1rem 2.25rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Icon placement */
.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform var(--transition-fast);
}

.btn:hover svg {
  transform: translateX(4px);
}

/* ==========================================
   4. FORM STYLES
   ========================================== */
.form-group {
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-family: var(--font-heading);
  font-size: var(--font-size-small);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.form-control,
.form-select,
.form-textarea {
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  padding: var(--space-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  width: 100%;
}

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

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  background: rgba(17, 25, 45, 0.8);
  border-color: var(--accent-tech);
  box-shadow: 0 0 0 1px var(--accent-tech), var(--glow-tech);
  outline: none;
}

/* Placeholder Color */
.form-control::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Dropdown Menu Arrow Color styling */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ebf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  background-size: 16px;
  padding-right: var(--space-2xl);
}

/* Option elements in dropdowns to prevent style bugs in dark mode */
.form-select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

/* Form Validation styles using modern state pseudo selectors */
.form-control:user-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

/* ==========================================
   5. FOOTER
   ========================================== */
.footer {
  background-color: rgba(7, 10, 18, 0.95);
  border-top: 1px solid var(--glass-border);
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  font-size: var(--font-size-small);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-brand p {
  color: var(--text-secondary);
  max-width: 300px;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-link {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.footer-contact-item svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-tech);
}

.footer-contact-item.whatsapp-item svg {
  fill: #25d366;
}
.footer-contact-item.whatsapp-item a:hover {
  color: #25d366;
  text-shadow: 0 0 10px rgba(37, 211, 102, 0.3);
}

.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
}

.footer-partners {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.partner-logo-zal {
  font-family: var(--font-heading);
  font-weight: var(--fw-extrabold);
  font-size: 1.15rem;
  letter-spacing: var(--ls-tight);
  color: #ffffff;
}

.partner-logo-zal span {
  color: var(--accent-tech);
}

.social-links {
  display: flex;
  gap: var(--space-md);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}

.social-link:hover {
  background: rgba(0, 235, 248, 0.08);
  border-color: var(--accent-tech);
  color: var(--accent-tech);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-legal {
  text-align: left;
}

.footer-info {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.footer-info .social-links {
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  
  .footer-top > :first-child {
    grid-column: span 2;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
    align-items: center;
  }
  
  .footer-legal, .footer-info {
    text-align: center;
    align-items: center;
  }
  
  .footer-info .social-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .footer-top {
    grid-template-columns: 1fr;
  }
  
  .footer-top > :first-child {
    grid-column: span 1;
  }
}

/* ==========================================
   6. GLASSMORPHISM MODAL / DIALOG
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 550px;
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 235, 248, 0.05);
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-spring), opacity var(--transition-normal);
  opacity: 0;
  text-align: center;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-icon-success {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(145, 80, 45, 0.15);
  border: 2px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl) auto;
  color: var(--success);
}

.modal-icon-success svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.modal-message {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: var(--lh-body);
}

/* ==========================================
   7. CUSTOM CHECKBOX FOR DARK MODE
   ========================================== */
.form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--glass-border-highlight);
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 2px;
  flex-shrink: 0;
  outline: none;
}

.form-checkbox:hover {
  border-color: var(--accent-tech);
  background-color: rgba(0, 235, 248, 0.05);
  box-shadow: 0 0 8px rgba(0, 235, 248, 0.25);
}

.form-checkbox:focus {
  border-color: var(--accent-tech);
  box-shadow: 0 0 0 2px rgba(0, 235, 248, 0.2);
}

.form-checkbox:checked {
  background: var(--gradient-tech);
  border-color: var(--accent-tech);
  box-shadow: 0 0 10px rgba(0, 235, 248, 0.3);
}

.form-checkbox:checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #0b0f19; /* Dark checkmark on cyan background gradient */
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  position: absolute;
  top: 2px;
  left: 5px;
}

/* ==========================================
   8. COOKIE & PRIVACY CONSENT BANNER
   ========================================== */
.cookie-banner {
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 850px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 235, 248, 0.05);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
}

.cookie-banner.active {
  bottom: var(--space-lg);
  opacity: 1;
  pointer-events: auto;
}

.cookie-content {
  flex: 1;
}

.cookie-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.cookie-title svg {
  width: 18px;
  height: 18px;
  fill: var(--accent-tech);
}

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0;
}

.cookie-text a {
  color: var(--accent-tech);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    bottom: -300px;
  }
  
  .cookie-banner.active {
    bottom: var(--space-md);
  }
  
  .cookie-actions {
    justify-content: flex-end;
  }
}

/* ==========================================
   9. RESPONSIVE GRID UTILITIES FOR FORMS & METRICS
   ========================================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.form-grid-email-phone {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: var(--space-md);
}

@media (max-width: 576px) {
  .form-grid-2,
  .form-grid-email-phone {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
}

/* ==========================================
   10. STRATEGIC MINI-AUDIT POPUP STYLES
   ========================================== */
.audit-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: var(--space-md);
}

.audit-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.audit-popup-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  background-color: rgba(21, 27, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 10, 159, 0.05);
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.audit-popup-overlay.active .audit-popup-card {
  transform: scale(1);
}

.audit-popup-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.audit-popup-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.audit-popup-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-md);
}

.audit-popup-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--gradient-sale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  box-shadow: 0 8px 20px rgba(255, 10, 159, 0.3);
}

.audit-popup-icon svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.audit-popup-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: var(--fw-bold);
  color: #ffffff;
  line-height: 1.3;
  margin-top: 4px;
}

.audit-popup-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
  margin-bottom: var(--space-lg);
}

.audit-popup-action {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.audit-popup-secondary-close {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-align: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-xs);
  transition: color var(--transition-fast);
}

.audit-popup-secondary-close:hover {
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .audit-popup-card {
    padding: var(--space-lg);
  }
  
  .audit-popup-title {
    font-size: 1.2rem;
  }
  
  .audit-popup-subtitle {
    font-size: 0.82rem;
  }
}

/* Fix per input radio e checkbox visibili */
input[type="checkbox"], input[type="radio"] {
  appearance: auto;
  -webkit-appearance: auto;
  width: 20px;
  height: 20px;
  accent-color: var(--accent-tech);
  cursor: pointer;
  border: 2px solid var(--text-primary);
  background-color: var(--bg-card);
  margin-right: 10px;
  display: inline-block;
  opacity: 1 !important;
}

/* Assicurati che l'opacità dei cerchi non sia nascosta in mini-audit o contatti */
.choice-circle {
    border: 2px solid var(--accent-tech);
    background-color: rgba(0,0,0,0.5);
    opacity: 1 !important;
}

/* Fix Disallineamento Griglia Dashboard */
.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    align-items: stretch !important;
}
.score-gauge-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.score-gauge-card .feedback-box {
    flex-grow: 1;
}
