/* 
 * Estilos para la aplicación iframe con banner y WhatsApp
 * Aplicando principios SOLID y mejores prácticas
 */

/* ==========================================================================
   Variables CSS (Custom Properties)
   ========================================================================== */

:root {
  /* Banner dimensions */
  --banner-height: 44px;
  --banner-height-mobile: 40px;
  
  /* Colors */
  --banner-gradient-start: #000032;
  --banner-gradient-end: #f7c038;
  --whatsapp-green: #25d366;
  --whatsapp-green-hover: #128c7e;
  --close-button-red: #ff4757;
  
  /* Z-index layers */
  --z-banner: 1000000;
  --z-floating-buttons: 999999;
  
  /* Spacing */
  --floating-buttons-gap: -15px;
  --banner-padding: 12px 20px;
  --banner-padding-mobile: 10px 15px;
  
  /* Font */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Estilos base
   ========================================================================== */

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-family);
}

/* ==========================================================================
   Banner de notificación
   ========================================================================== */

.notification-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--banner-gradient-start) 0%, var(--banner-gradient-start) 25%, var(--banner-gradient-end) 100%);
  color: white;
  padding: var(--banner-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(0);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: var(--z-banner);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  height: var(--banner-height);
  box-sizing: border-box;
}

.notification-banner.hidden {
  transform: translateY(-100%);
}

.notification-banner.pulse {
  animation: bannerPulse 2s ease-in-out infinite;
}

@keyframes bannerPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(247, 192, 56, 0.3);
  }
}

.notification-text {
  position: relative;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  flex: 1;
  text-align: center;
  display: inline-block;
}

.phone-number {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.phone-number:hover {
  text-decoration: none;
  color: inherit;
}

.phone-number::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  border-radius: 1px;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { 
    opacity: 0.7; 
  }
  50% { 
    opacity: 1; 
  }
}

.banner-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  margin-left: 10px;
  flex-shrink: 0;
}

.banner-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ==========================================================================
   Iframe principal
   ========================================================================== */

.main-iframe {
  position: absolute;
  top: var(--banner-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--banner-height));
  border: none;
  transition: all 0.4s ease;
}

.main-iframe.full-height {
  top: 0;
  height: 100vh;
}

/* ==========================================================================
   Botones flotantes de WhatsApp
   ========================================================================== */

.floating-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: var(--z-floating-buttons);
  display: flex;
  flex-direction: column;
  gap: var(--floating-buttons-gap);
  align-items: flex-end;
}

.whatsapp-button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 50px;
  height: 50px;
}

.whatsapp-link {
  width: 100%;
  height: 100%;
  background-color: var(--whatsapp-green);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.whatsapp-button:hover .whatsapp-link {
  transform: scale(1.1);
  background-color: var(--whatsapp-green-hover);
}

.close-whatsapp-btn {
  background: var(--close-button-red);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Utilidades
   ========================================================================== */

.hidden {
  display: none !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .notification-banner {
    padding: var(--banner-padding-mobile);
    height: var(--banner-height-mobile);
  }
  
  .main-iframe {
    top: var(--banner-height-mobile);
    height: calc(100vh - var(--banner-height-mobile));
  }
  
  .notification-text {
    font-size: 12px;
    margin-right: 10px;
  }
  
  .whatsapp-button {
    width: 45px;
    height: 45px;
  }
  
  .banner-close-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
}
