/* ===== BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: url("assets/fondo-login.png") no-repeat center center fixed;
  background-size: cover;
  color: white;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 0;
}

/* Ensure everything sits on top of the overlay */
.topbar, .chat-layout { position: relative; z-index: 1; }

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(15, 12, 8, 0.9);
  border-bottom: 1px solid rgba(245,185,66,0.15);
  flex-shrink: 0;
  animation: slideDown 0.6s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #f5b942;
  font-size: 16px;
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
}

.topbar-logo img {
  height: 30px;
  object-fit: contain;
}

.topbar-tabs {
  display: flex;
  gap: 4px;
}

.topbar-tabs a {
  text-decoration: none;
  color: rgba(255,255,255,0.6);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.topbar-tabs a:hover {
  color: white;
  background: rgba(255,255,255,0.05);
}

.topbar-tabs a.active {
  color: #f5b942;
  background: rgba(245,185,66,0.12);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}

.search-box input {
  background: transparent;
  border: none;
  color: white;
  outline: none;
  font-size: 13px;
  width: 140px;
  font-family: 'Inter', sans-serif;
}

.search-box input::placeholder { color: rgba(255,255,255,0.4); }

.icon-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: 0.2s;
}

.icon-btn:hover {
  background: rgba(245,185,66,0.15);
}

/* ===== CHAT LAYOUT ===== */
.chat-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== LEFT SIDEBAR ===== */
.chat-sidebar {
  width: 220px;
  background: rgba(15, 12, 8, 0.9);
  border-right: 1px solid rgba(245,185,66,0.1);
  display: flex;
  flex-direction: column;
  padding: 16px;
  flex-shrink: 0;
  animation: slideRight 0.5s ease;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section h4 {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.collab-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245,185,66,0.12);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(245,185,66,0.2);
  margin-bottom: 8px;
}

.collab-icon {
  font-size: 24px;
}

.collab-card strong {
  color: #f5b942;
  font-size: 14px;
  display: block;
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
}

.collab-card p {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  margin: 2px 0 0;
}

.channel {
  display: block;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 3px;
  transition: all 0.2s;
}

.channel:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.channel.active {
  background: rgba(245,185,66,0.15);
  color: #f5b942;
  font-weight: 600;
}

.invite-btn {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(245,185,66,0.3);
  border-radius: 10px;
  background: transparent;
  color: #f5b942;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s;
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.invite-btn:hover {
  background: rgba(245,185,66,0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245,185,66,0.3);
}

/* ===== MAIN CHAT ===== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(10, 8, 6, 0.5);
  animation: fadeIn 0.6s ease;
  min-height: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
  animation: pulse 2s ease infinite;
}

.chat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.chat-header-right {
  display: flex;
  gap: 6px;
}

/* ===== MESSAGES ===== */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 90%;
  animation: msgSlideIn 0.4s ease;
}

.message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5d487, #a6782c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: black;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255,215,0,0.3);
}

.msg-avatar.blue { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.msg-avatar.purple { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.msg-avatar.green { background: linear-gradient(135deg, #56ab2f, #a8e063); }

.msg-body {
  background: rgba(255,255,255,0.05);
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
}

.message.sent .msg-body {
  background: rgba(245,185,66,0.15);
  border-color: rgba(245,185,66,0.25);
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.msg-name {
  font-weight: 600;
  font-size: 13px;
  color: #f5b942;
  text-shadow: 0 0 6px rgba(255,215,0,0.4);
}

.msg-time {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

.msg-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
}

/* File attachment */
.msg-file {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.3);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid rgba(245,185,66,0.15);
}

.msg-file-icon { font-size: 26px; }

.msg-file-info strong {
  display: block;
  font-size: 13px;
  color: white;
}

.msg-file-info span {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

.download-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  background: linear-gradient(120deg, #f5d487, #e0b45c, #a6782c);
  background-size: 200% 200%;
  animation: goldShine 3s linear infinite;
  color: black;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: 0.3s;
}

.download-btn:hover {
  box-shadow: 0 0 15px rgba(255,215,0,0.5);
  transform: scale(1.05);
}

/* ===== INPUT AREA ===== */
.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 24px 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  padding: 12px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: 0.2s;
}

.chat-input-area input:focus {
  border-color: #f5b942;
  box-shadow: 0 0 15px rgba(255,215,0,0.15);
}

.send-btn {
  padding: 12px 22px;
  background: linear-gradient(120deg, #f5d487, #e0b45c, #a6782c);
  background-size: 200% 200%;
  animation: goldShine 3s linear infinite;
  color: black;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  font-size: 13px;
  transition: 0.3s;
}

.send-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px rgba(255,215,0,0.5);
}

.chat-tools {
  display: flex;
  gap: 6px;
  padding: 4px 24px 14px;
  flex-shrink: 0;
}

.tool-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: 0.2s;
}

.tool-btn:hover { background: rgba(255,255,255,0.08); }

/* ===== RIGHT PANEL ===== */
.chat-panel {
  width: 230px;
  background: rgba(15, 12, 8, 0.9);
  border-left: 1px solid rgba(245,185,66,0.1);
  padding: 20px 16px;
  flex-shrink: 0;
  overflow-y: auto;
  animation: slideLeft 0.5s ease;
}

.chat-panel h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #f5b942;
  text-shadow: 0 0 8px rgba(255,215,0,0.5);
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: 0.2s;
  animation: fadeIn 0.5s ease;
}

.team-member:hover {
  background: rgba(255,255,255,0.05);
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: black;
  flex-shrink: 0;
  position: relative;
}

.member-avatar.gold { background: linear-gradient(135deg, #f5d487, #a6782c); }
.member-avatar.blue { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.member-avatar.green { background: linear-gradient(135deg, #56ab2f, #a8e063); }

.member-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #0e0e0e;
}

.member-status.online { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.6); }
.member-status.idle { background: #fbbf24; }
.member-status.offline { background: #666; }

.member-info strong {
  display: block;
  font-size: 13px;
  color: white;
}

.member-info span {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* Panel sections */
.panel-section {
  margin-bottom: 20px;
}

.panel-section h5 {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: #f5b942;
  color: black;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.invite-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.reenviar-btn {
  background: transparent;
  border: none;
  color: #f5b942;
  font-weight: 700;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
  transition: 0.2s;
}

.reenviar-btn:hover {
  text-shadow: 0 0 10px rgba(255,215,0,0.6);
}

/* Storage */
.storage {
  text-align: center;
}

.storage-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
}

.storage-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  margin: 8px 0 4px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, #f5b942, #e0b45c);
  border-radius: 4px;
  transition: width 1s ease;
}

.storage-pct {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* ===== SPARKS ===== */
.spark {
  position: fixed;
  bottom: -10px;
  background: #ffb938;
  border-radius: 50%;
  box-shadow: 0 0 8px #ffd700, 0 0 16px #ffb938;
  pointer-events: none;
  z-index: 9999;
  animation: sparkFloat linear forwards;
}

/* ===== ANIMATIONS ===== */
@keyframes goldShine {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

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

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

@keyframes slideLeft {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(74,222,128,0.4); }
  50%      { box-shadow: 0 0 12px rgba(74,222,128,0.8); }
}

@keyframes sparkFloat {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 0.8; }
  100% { transform: translateY(-110vh) scale(0); opacity: 0; }
}

/* ===== SCROLLBAR ===== */
.messages::-webkit-scrollbar,
.chat-sidebar::-webkit-scrollbar,
.chat-panel::-webkit-scrollbar {
  width: 5px;
}

.messages::-webkit-scrollbar-thumb,
.chat-sidebar::-webkit-scrollbar-thumb,
.chat-panel::-webkit-scrollbar-thumb {
  background: rgba(245,185,66,0.3);
  border-radius: 10px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .chat-panel { display: none; }
  .chat-sidebar { width: 180px; }
}

@media (max-width: 600px) {
  .chat-sidebar { display: none; }
  .topbar-tabs { display: none; }
  .search-box { display: none; }
  .topbar-logo span { display: none; } /* Hide logo text to prevent overflow */
}

/* HAMBURGER MENU TOGGLE */
.menu-toggle {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10005; /* Must be higher than overlay modal */
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  background-color: #ffd700;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Hamburger animations to 'X' */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile drawer style */
.mobile-nav {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: -280px; /* Hidden offscreen on the right */
  width: 280px;
  height: 100vh;
  background: rgba(15, 12, 10, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 215, 0, 0.25);
  padding: 80px 24px 40px; /* Padding top for layout spacing */
  gap: 20px;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  z-index: 10000; /* Must be higher than other elements */
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav a {
  font-size: 16px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.05);
  display: flex;
  align-items: center;
  color: #ccc;
  text-decoration: none;
  transition: all 0.3s ease;
}

.mobile-nav a:hover, .mobile-nav a.active {
  background: rgba(255, 215, 0, 0.08);
  color: #f59f0a;
  border-bottom-color: rgba(255, 215, 0, 0.2);
  padding-left: 24px;
}

/* RESPONSIVE TOGGLES */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  .mobile-nav {
    display: flex;
  }
}

/* =========================================
   MODALES Y PANELES (NUEVO ESTILO REVISIONES/INVITAR)
   ========================================= */

.overlay-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}

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

.modal-content {
  width: 90%;
  max-width: 500px;
  background: rgba(20, 15, 10, 0.95);
  padding: 30px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.overlay-modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.modal-header h3 {
  margin: 0;
  color: #FFD700;
  font-size: 1.4rem;
}

.close-modal {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.close-modal:hover { opacity: 1; }

.invite-desc { color: rgba(255,255,255,0.6); font-size: 14px; margin-bottom: 25px; }
.invite-box { margin-bottom: 20px; }
.invite-box label { display: block; font-size: 11px; color: #FFD700; text-transform: uppercase; margin-bottom: 8px; }
.link-field { display: flex; gap: 10px; }
.link-field input { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #fff; padding: 10px; font-size: 13px; }
.link-field button { background: #FFD700; border: none; padding: 0 15px; border-radius: 8px; font-weight: 700; cursor: pointer; }

.revision-item {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 3px solid #FFD700;
}
.revision-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
.revision-name { font-weight: 600; color: #FFD700; }
.revision-time { font-size: 11px; color: rgba(255,255,255,0.4); }
.revision-text { font-size: 13px; color: rgba(255,255,255,0.8); }

.share-options { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.share-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; border: none; cursor: pointer; }
.share-icon.wa { background: #25D366; }
.share-icon.fb { background: #1877F2; }
.share-icon.tw { background: #000; border: 1px solid #333; }
