/* ============================================
   FLOATING WINDOWS SYSTEM
   Sistema de 3 ventanas flotantes independientes
   ============================================ */

/* Botones flotantes de activación */
.floating-triggers {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 8999;
}

.floating-trigger-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
}

.floating-trigger-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.trigger-news {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.trigger-prompt {
  background: linear-gradient(135deg, #00a79d, #7e3e97);
}

.trigger-research {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

/* Badge de notificaciones */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4444;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid white;
}

/* Área de información de usuario en header PROMPT */
.user-info-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  margin-right: 0.5rem;
  flex-wrap: wrap;
}

/* Badge de usuario en header */
.user-badge-header {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.user-badge-header i {
  font-size: 0.9rem;
}

/* Botón de logout en header */
.logout-btn-header {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.logout-btn-header:hover {
  background: rgba(244, 67, 54, 0.9);
  border-color: rgba(244, 67, 54, 1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

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

/* Responsive: ocultar texto en móviles pequeños */
@media (max-width: 480px) {
  .logout-btn-header {
    padding: 0.4rem 0.6rem;
    font-size: 0;
  }

  .logout-btn-header i {
    font-size: 1rem;
    margin: 0;
  }

  .user-badge-header {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Ventanas flotantes */
.floating-window {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 450px;
  height: 600px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  z-index: 9000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  min-width: 300px;
  min-height: 400px;
  max-width: 90vw;
  max-height: 90vh;
}

.floating-window.active {
  display: flex;
  animation: slideInUp 0.3s ease-out;
}

.floating-window.maximized {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
  resize: none;
}

/* Header de ventana */
.window-header {
  background: linear-gradient(135deg, #00a79d, #7e3e97);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  user-select: none;
  gap: 1rem;
}

.window-header.news-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.window-header.research-header {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.window-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.window-controls {
  display: flex;
  gap: 0.5rem;
}

.window-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.window-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

.minimize-btn:hover {
  background: rgba(255, 193, 7, 0.8);
}

.maximize-btn:hover {
  background: rgba(76, 175, 80, 0.8);
}

.close-btn:hover {
  background: rgba(244, 67, 54, 0.8);
}

/* Cuerpo de ventana */
.window-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f5f8fc;
}

/* ============================================
   VENTANA PROMPT - ESTRUCTURA
   ============================================ */

/* Pestañas de categoría (Texto/Imagen/Video/Sonido) */
.category-tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid #e0e0e0;
  padding: 0.5rem 1rem 0;
  gap: 0.5rem;
}

.category-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.category-tab:hover {
  background: rgba(0, 167, 157, 0.1);
  color: #00a79d;
}

.category-tab.active {
  background: #00a79d;
  color: white;
  box-shadow: 0 -2px 8px rgba(0, 167, 157, 0.3);
}

/* Pestañas de nivel (Básico/Avanzado) */
.level-tabs {
  display: flex;
  background: white;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.level-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
  text-align: center;
}

.level-tab:hover {
  background: #e9ecef;
  border-color: #00a79d;
}

.level-tab.active {
  background: #7e3e97;
  color: white;
  border-color: #7e3e97;
}

/* Contenido de la ventana */
.window-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* Grid de contenido */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Grid más compacto para carpetas */
#texto-avanzado-folders,
#imagen-avanzado-folders,
#video-avanzado-folders,
#sonido-avanzado-folders {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.875rem;
}

.content-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Tarjetas de carpeta más compactas */
.folder-card {
  padding: 1rem 1.25rem;
}

.folder-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.folder-card p {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.content-card:hover {
  border-color: #00a79d;
  box-shadow: 0 4px 12px rgba(0, 167, 157, 0.15);
  transform: translateY(-4px);
}

.content-card h3 {
  color: #0a2540;
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
}

.content-card p {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.btn-open {
  width: 100%;
  padding: 0.75rem;
  background: #00a79d;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-open:hover {
  background: #7e3e97;
  transform: translateY(-2px);
}

.btn-open:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  transform: none;
  opacity: 0.6;
}

.btn-open:disabled:hover {
  background: #ccc;
  transform: none;
}

/* Estado VIP requerido */
.vip-required {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(218, 165, 32, 0.1));
  border: 2px dashed #daa520;
  border-radius: 12px;
  margin: 1rem 0;
}

.vip-required i {
  font-size: 3rem;
  color: #daa520;
  margin-bottom: 1rem;
  display: block;
}

.vip-required h3 {
  color: #b8860b;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.vip-required p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #999;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  color: #666;
  margin-bottom: 0.5rem;
}

/* ============================================
   SISTEMA DE CARPETAS Y NAVEGACIÓN
   ============================================ */

/* Tarjeta de Carpeta */
.folder-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 4px solid #00a79d;
  position: relative;
  overflow: hidden;
}

.folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 167, 157, 0.05), rgba(126, 62, 151, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.folder-card:hover::before {
  opacity: 1;
}

.folder-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 167, 157, 0.2);
  border-left-color: #7e3e97;
}

.folder-icon {
  font-size: 2rem;
  color: #00a79d;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.folder-card:hover .folder-icon {
  color: #7e3e97;
  transform: scale(1.1);
}

.folder-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.8rem;
  color: #666;
}

.folder-meta i {
  color: #00a79d;
}

/* Vista de Módulos */
.modules-view {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #00a79d;
}

.btn-back {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #333;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-back:hover {
  background: #00a79d;
  color: white;
  border-color: #00a79d;
  transform: translateX(-3px);
}

.breadcrumb-path {
  color: #666;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-path i {
  color: #00a79d;
}

/* Tarjeta de Módulo Individual */
.module-card {
  position: relative;
  padding: 1rem 1rem 1.25rem 1rem;
  padding-top: 2.5rem;
}

.module-number {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #00a79d, #7e3e97);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 167, 157, 0.3);
}

.module-card h3 {
  color: #333;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.module-card p {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.module-card .btn-open {
  padding: 0.6rem;
  font-size: 0.85rem;
}

.module-card p {
  color: #666;
  line-height: 1.6;
}

.module-card:hover {
  border-left-color: #7e3e97;
}

/* ============================================
   VENTANA NOTICIAS
   ============================================ */

.news-content {
  padding: 1rem;
}

.news-card {
  background: white;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.news-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem 0;
  color: #0a2540;
  font-weight: 600;
}

.news-card .summary {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  line-height: 1.6;
  color: #444;
}

.news-card .source {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  color: #666;
  border-top: 1px solid #e0e0e0;
  padding-top: 0.5rem;
}

.news-card a {
  color: #00a79d;
  text-decoration: none;
  font-weight: 500;
}

.news-card a:hover {
  color: #7e3e97;
  text-decoration: underline;
}

/* ============================================
   VENTANA INVESTIGACIÓN
   ============================================ */

.research-content {
  padding: 1rem;
}

.research-card {
  background: white;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #f093fb;
  transition: all 0.3s ease;
}

.research-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(240, 147, 251, 0.2);
}

.research-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem 0;
  color: #0a2540;
  font-weight: 600;
}

.research-card .summary {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  line-height: 1.6;
  color: #444;
}

.research-card .source {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  color: #666;
  border-top: 1px solid #e0e0e0;
  padding-top: 0.5rem;
}

/* ============================================
   LOGIN MODAL (para PROMPT)
   ============================================ */

.login-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 23, 47, 0.85);
  backdrop-filter: blur(5px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.login-overlay.show {
  display: flex;
}

.login-box {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideDown 0.3s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-header h2 {
  color: #0a2540;
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.login-header p {
  color: #666;
  font-size: 0.95rem;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #0a2540;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #00a79d;
  box-shadow: 0 0 0 3px rgba(0, 167, 157, 0.1);
}

.login-error {
  background: #fee;
  border: 2px solid #fcc;
  border-radius: 8px;
  padding: 0.75rem;
  color: #c33;
  font-size: 0.9rem;
  display: none;
}

.login-error.show {
  display: block;
}

.login-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-login {
  flex: 1;
  padding: 0.75rem;
  background: #00a79d;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background: #7e3e97;
  transform: translateY(-2px);
}

.btn-cancel {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  color: #666;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: #f8f9fa;
  border-color: #999;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .floating-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 10px;
    height: 70vh;
  }

  .floating-window.maximized {
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
  }

  .category-tabs {
    padding: 0.25rem 0.5rem 0;
    gap: 0.25rem;
  }

  .category-tab {
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
  }

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

  .floating-triggers {
    right: 10px;
    bottom: 10px;
  }

  .floating-trigger-btn {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .user-info-area {
    gap: 0.5rem;
  }

  .user-badge-header {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .logout-btn-header {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }

  .logout-btn-header span {
    display: none;
  }
}

/* Scrollbar personalizada */
.window-content::-webkit-scrollbar {
  width: 8px;
}

.window-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.window-content::-webkit-scrollbar-thumb {
  background: #00a79d;
  border-radius: 10px;
}

.window-content::-webkit-scrollbar-thumb:hover {
  background: #7e3e97;
}
