/* ============================================================
   UNIFICOVANÁ PATIČKA A MODÁLY PRO LUKASDAVID.CZ
   Kompatibilní s vlastním CSS (index.html) i Tailwind (kalkulačky)
   ============================================================ */

/* CSS Proměnné pro obě barevná schémata */
:root {
  /* Light mode (index.html, style.css) */
  --ld-footer-bg: #0f172a;
  --ld-footer-text: #f8fafc;
  --ld-footer-text-secondary: #94a3b8;
  --ld-footer-border: #1e293b;
  --ld-footer-gold: #d4af37;
  --ld-footer-gold-hover: #c49b2a;
  --ld-footer-card-bg: #1e293b;
  --ld-footer-overlay: rgba(0, 0, 0, 0.7);
  --ld-footer-modal-bg: #1e293b;
  --ld-footer-input-bg: #0f172a;
  --ld-footer-input-border: #334155;
  --ld-footer-focus: #d4af37;
  --ld-footer-green: #22c55e;
  --ld-footer-red: #ef4444;
  --ld-footer-yellow: #facc15;
}

/* Dark mode (kalkulačky) - používají stejné proměnné */
/* Proměnné jsou shodné s Tailwind navy-dark palette */

/* ============================================================
   PATIČKA
   ============================================================ */
#ld-footer {
  background: var(--ld-footer-bg);
  color: var(--ld-footer-text);
  border-top: 1px solid var(--ld-footer-border);
  padding: 24px 16px;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  width: 100%;
  box-sizing: border-box;
}

#ld-footer .ld-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

#ld-footer .ld-brand {
  color: var(--ld-footer-gold);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: block;
}

#ld-footer .ld-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-bottom: 16px;
}

#ld-footer .ld-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ld-footer-text-secondary);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  transition: color 0.2s;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#ld-footer .ld-link:hover {
  color: var(--ld-footer-gold);
}

#ld-footer .ld-separator {
  color: var(--ld-footer-border);
  user-select: none;
}

#ld-footer .ld-legal {
  color: var(--ld-footer-text-secondary);
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 16px;
}

#ld-footer .ld-copy {
  color: var(--ld-footer-text-secondary);
  font-size: 12px;
  border-top: 1px solid var(--ld-footer-border);
  padding-top: 16px;
  margin-top: 8px;
}

#ld-footer .ld-vibiz {
  color: var(--ld-footer-text-secondary);
  font-size: 12px;
  margin-top: 8px;
}

#ld-footer .ld-vibiz a {
  color: var(--ld-footer-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#ld-footer .ld-vibiz a:hover {
  color: var(--ld-footer-gold);
}

/* ============================================================
   MODÁLY (Overlay)
   ============================================================ */
.ld-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--ld-footer-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  backdrop-filter: blur(4px);
}

.ld-modal-overlay.ld-open {
  opacity: 1;
  visibility: visible;
}

.ld-modal-content {
  background: var(--ld-footer-modal-bg);
  color: var(--ld-footer-text);
  border: 1px solid var(--ld-footer-border);
  border-radius: 16px;
  padding: 28px;
  max-width: 780px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.ld-modal-overlay.ld-open .ld-modal-content {
  transform: scale(1) translateY(0);
}

.ld-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: var(--ld-footer-input-bg);
  border: 1px solid var(--ld-footer-border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ld-footer-text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  transition: all 0.2s;
  z-index: 2;
}

.ld-modal-close:hover {
  background: var(--ld-footer-border);
  color: var(--ld-footer-gold);
  border-color: var(--ld-footer-gold);
}

.ld-modal-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 3vw, 24px);
  color: var(--ld-footer-gold);
  margin: 0 0 8px;
  padding-right: 40px;
}

.ld-modal-subtitle {
  font-size: 0.85rem;
  color: var(--ld-footer-text-secondary);
  margin: 0 0 24px;
}

.ld-modal-section {
  margin-bottom: 28px;
}

.ld-modal-section:last-child {
  margin-bottom: 0;
}

.ld-modal-section h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ld-footer-text);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ld-footer-border);
}

.ld-modal-section p {
  font-size: 0.9rem;
  color: var(--ld-footer-text);
  line-height: 1.7;
  margin: 0 0 12px;
}

.ld-modal-section p:last-child {
  margin-bottom: 0;
}

.ld-modal-section ul {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--ld-footer-text);
  line-height: 1.7;
}

.ld-modal-section li {
  margin-bottom: 6px;
}

.ld-modal-section strong {
  color: var(--ld-footer-gold);
}

.ld-modal-section a {
  color: var(--ld-footer-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.ld-modal-section a:hover {
  color: var(--ld-footer-gold-hover);
}

.ld-modal-box {
  background: var(--ld-footer-input-bg);
  border: 1px solid var(--ld-footer-border);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
  font-size: 0.85rem;
  color: var(--ld-footer-text-secondary);
  line-height: 1.6;
}

.ld-modal-box strong {
  color: var(--ld-footer-text);
}

.ld-modal-highlight {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px 0;
  font-size: 0.85rem;
  color: var(--ld-footer-text-secondary);
  line-height: 1.6;
}

.ld-modal-highlight strong {
  color: var(--ld-footer-gold);
}

/* ============================================================
   RESPONZIVITA
   ============================================================ */
@media (max-width: 640px) {
  #ld-footer {
    padding: 20px 12px;
  }
  
  #ld-footer .ld-links {
    flex-direction: column;
    gap: 8px;
  }
  
  #ld-footer .ld-separator {
    display: none;
  }
  
  .ld-modal-content {
    padding: 20px 16px;
    margin: 8px;
    max-height: 90vh;
    border-radius: 12px;
  }
  
  .ld-modal-title {
    font-size: 1.25rem;
  }
  
  .ld-modal-section h3 {
    font-size: 0.95rem;
  }
  
  .ld-modal-section p,
  .ld-modal-section ul {
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  #ld-footer .ld-brand {
    font-size: 13px;
  }
  
  #ld-footer .ld-link {
    font-size: 12px;
  }
  
  .ld-modal-close {
    width: 36px;
    height: 36px;
    top: 8px;
    right: 10px;
  }
}

/* ============================================================
   ANIMACE PRO FADE-IN (pro konzistenci s index.html)
   ============================================================ */
.ld-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.ld-fade-in.ld-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ld-modal-overlay,
  .ld-modal-content,
  .ld-fade-in {
    transition: none !important;
  }
}