/* ============================================================
   DENTAL ORIENTE — Custom Styles
   Futurista · Azul · Glassmorphism · Dark
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --bg-primary:    #050B18;
  --bg-secondary:  #080F20;
  --bg-card:       rgba(255,255,255,0.04);
  --accent:        #38BDF8;
  --accent-2:      #818CF8;
  --accent-glow:   rgba(56,189,248,0.3);
  --text-primary:  #F0F6FF;
  --text-secondary:#8BAABF;
  --border:        rgba(56,189,248,0.12);
  --glass-bg:      rgba(10,20,40,0.7);
  --glass-border:  rgba(56,189,248,0.12);
}

/* ---- Base Reset & Typography ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(56,189,248,0.25);
  color: #fff;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent)/40; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-gradient-blue {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  position: relative;
}

.glass-dark {
  background: rgba(5,11,24,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, #0EA5E9 100%);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.01em;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 28px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.01em;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  background: rgba(56,189,248,0.05);
}

/* Section helpers */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
  text-align: center;
}

.section-title-left {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* ============================================================
   HEADER
   ============================================================ */
#header {
  background: transparent;
  transition: background 0.4s, box-shadow 0.4s, backdrop-filter 0.4s;
}

#header.scrolled {
  background: rgba(5,11,24,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(56,189,248,0.1);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-bg {
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(56,189,248,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 30% 70%, rgba(129,140,248,0.05) 0%, transparent 70%),
    linear-gradient(180deg, #050B18 0%, #080F20 100%);
}

.grid-overlay {
  background-image:
    linear-gradient(rgba(56,189,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-image-container {
  clip-path: polygon(8% 0%, 100% 0%, 100% 100%, 0% 100%);
  border-radius: 0 24px 24px 0;
  overflow: hidden;
}

@media (max-width: 1023px) {
  .hero-image-container {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 92%);
    border-radius: 24px;
  }
}

.hero-img {
  transform-origin: center;
  transition: transform 8s ease;
}

.hero-img:hover { transform: scale(1.03); }

.hero-img-overlay {
  background: linear-gradient(
    to right,
    rgba(5,11,24,0.6) 0%,
    transparent 40%,
    transparent 60%,
    rgba(5,11,24,0.3) 100%
  );
}

/* Floating cards animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.float-card {
  animation: float 4s ease-in-out infinite;
}

/* Scroll indicator */
@keyframes scrollBounce {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}

/* ============================================================
   SERVICES
   ============================================================ */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.25);
}

.services-cta-card {
  background: linear-gradient(135deg, rgba(56,189,248,0.08) 0%, rgba(129,140,248,0.06) 100%);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ============================================================
   ABOUT / TEAM
   ============================================================ */
.about-img-overlay {
  background: linear-gradient(to top, rgba(5,11,24,0.5) 0%, transparent 50%);
}

.team-img-overlay {
  background: linear-gradient(to top, rgba(5,11,24,0.7) 0%, transparent 50%);
}

.team-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(56,189,248,0.08);
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonios-bg {
  background:
    radial-gradient(ellipse 100% 60% at 50% 50%, rgba(56,189,248,0.03) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

.testimonial-card {
  transition: transform 0.3s ease, border-color 0.3s ease;
  animation-delay: calc(var(--i) * 0.1s);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,0.2);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-item {
  position: relative;
}

.gallery-thumb {
  position: relative;
}

.gallery-overlay {
  background: linear-gradient(135deg, rgba(56,189,248,0.3) 0%, rgba(5,11,24,0.6) 100%);
  border-radius: 12px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item.hidden-item {
  display: none;
}

/* Gallery tabs */
.gallery-tab {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  background: transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-tab:hover,
.gallery-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56,189,248,0.08);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  display: none;
}

.lightbox.open {
  display: flex;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox.open .lightbox-content {
  animation: lightboxIn 0.25s ease-out;
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-bg {
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(56,189,248,0.06) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-bg {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, #030810 100%);
}

/* Form styles */
.form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(56,189,248,0.15);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9375rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-input::placeholder { color: rgba(139,170,191,0.5); }

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.1);
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2338BDF8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select.form-input option {
  background: #0a1428;
  color: var(--text-primary);
}

/* ============================================================
   CHAT WIDGET — Ayuda Activa
   ============================================================ */

/* Pulse ring animation for the toggle button */
@keyframes chatPulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.chat-pulse-ring {
  background: rgba(56,189,248,0.4);
  animation: chatPulse 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

/* Stop pulse when open */
#chat-widget.chat-open .chat-pulse-ring {
  animation: none;
  opacity: 0;
}

.chat-toggle-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #0EA5E9 100%);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 32px rgba(56,189,248,0.4);
}

.chat-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(56,189,248,0.5);
}

/* Panel animation */
@keyframes panelSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); transform-origin: bottom right; }
  to   { opacity: 1; transform: translateY(0)   scale(1);    transform-origin: bottom right; }
}

.chat-panel {
  animation: panelSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.chat-panel.hidden { display: none !important; }

.chat-panel:not(.hidden) {
  display: flex !important;
}

.chat-header {
  background: linear-gradient(135deg, rgba(56,189,248,0.12) 0%, rgba(8,15,32,0.8) 100%);
  border-bottom: 1px solid rgba(56,189,248,0.15);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bubble styles */
.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble.user {
  background: linear-gradient(135deg, var(--accent) 0%, #0EA5E9 100%);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(56,189,248,0.12);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.typing {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(56,189,248,0.12);
  align-self: flex-start;
  padding: 12px 16px;
  border-bottom-left-radius: 4px;
}

/* Typing dots */
@keyframes typingDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: typingDot 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

.chat-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(56,189,248,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input::placeholder { color: rgba(139,170,191,0.4); }

.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent) 0%, #0EA5E9 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(56,189,248,0.3);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   REVEAL ANIMATIONS (Intersection Observer)
   ============================================================ */
.reveal-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.33,1,0.68,1),
              transform 0.6s cubic-bezier(0.33,1,0.68,1);
}

.reveal-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays via CSS custom property --i */
.reveal-item[style*="--i:0"] { transition-delay: 0ms; }
.reveal-item[style*="--i:1"] { transition-delay: 80ms; }
.reveal-item[style*="--i:2"] { transition-delay: 160ms; }
.reveal-item[style*="--i:3"] { transition-delay: 240ms; }
.reveal-item[style*="--i:4"] { transition-delay: 320ms; }
.reveal-item[style*="--i:5"] { transition-delay: 400ms; }
.reveal-item[style*="--i:6"] { transition-delay: 480ms; }
.reveal-item[style*="--i:7"] { transition-delay: 560ms; }
.reveal-item[style*="--i:8"] { transition-delay: 640ms; }

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 640px) {
  .hero-split { padding-top: 2rem; }
  .float-card { display: none; }

  #lightbox-prev { left: 8px; transform: translateY(-50%) translateX(0); }
  #lightbox-next { right: 8px; transform: translateY(-50%) translateX(0); }

  .gallery-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   FINE DECORATIVE DETAILS
   ============================================================ */

/* Thin accent line on glass cards when hovered */
.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.glass-card:hover::after {
  opacity: 1;
}
