/* =============================================================================
   PATH: static/css/global.css
   CONNECTS TO: CALLED BY: layouts/html/admin_layout (2).html, layouts/html/admin_layout_backup.html, layouts/html/layout_backup.html, templates/admin_layout.html, templates/layout.html
   DESCRIPTION: Recurso frontend (CSS)
   ============================================================================= */

/* ========================================
   RED SOCIAL - Enterprise CSS
   Modern, accessible, beautiful
   ======================================== */

:root {
  /* Colors - Light Mode */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --accent: #06b6d4;
  
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-input: #ffffff;
  
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #6366f1;
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
}

/* Dark Mode - High contrast text */
.dark {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --bg-input: #1e293b;
  
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border: #334155;
  --border-focus: #818cf8;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.5em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ========================================
   LAYOUT
   ======================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 380px 1fr; /* Igual que el widget de música */
  }
}

/* ========================================
   TOPBAR / NAVIGATION
   ======================================== */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
}

.dark .topbar {
  background: rgba(30, 41, 59, 0.9);
}

.topbar .brand {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar .nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

@media (min-width: 768px) {
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .topbar .nav {
    margin-top: 0;
  }
}

.topbar .nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.topbar .nav a:hover {
  color: var(--primary);
  background: var(--bg-hover);
  text-decoration: none;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.dark .card.glass {
  background: rgba(30, 41, 59, 0.7);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  background: var(--bg-hover);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}

.btn.secondary {
  background: linear-gradient(135deg, var(--secondary), #db2777);
  color: white;
}

.btn.outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn.outline:hover {
  background: var(--primary);
  color: white;
}

.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn.ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn.full {
  width: 100%;
}

.btn.sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn.lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* ========================================
   FORMS
   ======================================== */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  transition: var(--transition);
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* File Input */
input[type="file"] {
  padding: 0.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-hover);
  cursor: pointer;
}

input[type="file"]:hover {
  border-color: var(--primary);
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
  color: var(--accent);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-container {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  text-align: center;
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.auth-card .form {
  text-align: left;
}

.auth-card .divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-card .divider::before,
.auth-card .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-card .footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ========================================
   FEED & POSTS
   ======================================== */
.feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post {
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Post Options Menu */
.post-options {
  position: relative;
}

.post-menu-btn {
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
}

.post-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  z-index: 100;
  overflow: hidden;
}

.post-menu a,
.post-menu button {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.post-menu a:hover,
.post-menu button:hover {
  background: var(--bg-hover);
}

.post-menu button.danger {
  color: var(--error);
}

.post-menu button.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

.post-user {
  font-weight: 600;
  color: var(--text);
}

.post-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-text {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

/* Hashtags and Mentions */
.hashtag,
.mention {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}

.hashtag:hover,
.mention:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.hashtag {
  background: rgba(99, 102, 241, 0.1);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.mention {
  background: rgba(236, 72, 153, 0.1);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.dark .hashtag {
  background: rgba(99, 102, 241, 0.2);
}

.dark .mention {
  background: rgba(236, 72, 153, 0.2);
}

.post-media {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.post-media img,
.post-media video {
  width: 100%;
  display: block;
}

/* ========================================
   REACTIONS
   ======================================== */
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.chip .count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

/* ========================================
   COMMENTS
   ======================================== */
.comments {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.comments summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
}

.comments summary:hover {
  color: var(--primary);
}

.comment {
  padding: 0.75rem;
  background: var(--bg-hover);
  border-radius: var(--radius);
  margin: 0.75rem 0;
}

.comment-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.comment-form input {
  flex: 1;
}

/* ========================================
   SIDEBAR / CHAT
   ======================================== */
.sidebar {
  position: static !important; /* Estático, no se mueve */
  height: calc(100vh - 120px) !important; /* Altura completa menos topbar */
  overflow-y: auto !important; /* Scroll para todo el sidebar */
  overflow-x: hidden !important; /* Sin scroll horizontal */
  padding-right: 8px !important; /* Espacio para scrollbar */
  max-height: calc(100vh - 120px) !important;
}

/* Scrollbar personalizado para sidebar */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--bg-hover);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Todos los widgets del sidebar con 380px de ancho - SOBREESCRIBIR FUTURISTIC.CSS */
aside.sidebar .card,
aside.sidebar > div[class*="card"],
aside.sidebar .music-widget,
aside.sidebar .chat-card,
aside.sidebar .user-card,
aside.sidebar .composer,
aside.sidebar > * {
  width: 380px !important;
  max-width: 380px !important;
  min-width: 380px !important;
  flex: none !important; /* Evitar flex que pueda cambiar el tamaño */
}

/* Forzar ancho en todos los elementos del sidebar - MÁS ESPECÍFICO */
.grid > .sidebar > * {
  width: 380px !important;
  max-width: 380px !important;
  min-width: 380px !important;
}

/* Excepción para elementos que no deben tener ancho fijo */
.sidebar .chat-form,
.sidebar .chatlog,
.sidebar .actions,
.sidebar button,
.sidebar input,
.sidebar textarea,
.sidebar select,
.sidebar .row,
.sidebar .avatar {
  width: auto !important;
  max-width: none !important;
  min-width: auto !important;
}

.chatlog {
  height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-hover);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.chat-message {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  animation: slideIn 0.2s ease;
}

.chat-message.own {
  background: var(--primary);
  color: white;
  margin-left: 2rem;
}

/* ========================================
   COMPOSER
   ======================================== */
.composer {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
}

.composer textarea {
  border: none;
  background: transparent;
  resize: none;
  min-height: 80px;
}

.composer textarea:focus {
  box-shadow: none;
}

.composer .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ========================================
   LOADING STATES
   ======================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   UTILITIES
   ======================================== */
.row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 767px) {
  .container {
    padding: 1rem;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  .topbar {
    padding: 1rem;
  }
  
  .topbar .nav {
    flex-wrap: wrap;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  
  .reactions {
    gap: 0.375rem;
  }
  
  .chip {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--primary); }
  50% { box-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary-light); }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-shake { animation: shake 0.5s; }
.animate-heartbeat { animation: heartBeat 1s; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }
.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }

/* ========================================
   MICRO-INTERACTIONS
   ======================================== */

/* Button Ripple Effect */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--primary-light) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.5s;
}

.btn:active::after {
  transform: scale(0);
  opacity: 0.3;
  transition: 0s;
}

/* Like Button Animation */
.chip.active .emoji,
.reaction-btn.active .emoji {
  animation: heartBeat 0.6s;
}

.chip:active,
.reaction-btn:active {
  transform: scale(0.95);
}

/* Card Hover Effects */
.card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.card.no-hover:hover {
  transform: none;
  box-shadow: var(--shadow);
}

/* Post Card Entrance */
.post {
  animation: fadeInUp 0.5s ease backwards;
}

.post:nth-child(1) { animation-delay: 0s; }
.post:nth-child(2) { animation-delay: 0.1s; }
.post:nth-child(3) { animation-delay: 0.2s; }
.post:nth-child(4) { animation-delay: 0.3s; }
.post:nth-child(5) { animation-delay: 0.4s; }

/* Avatar Hover */
.avatar {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Input Focus Animation */
input:focus,
textarea:focus,
select:focus {
  animation: scaleIn 0.2s ease;
}

/* Link Underline Animation */
a.animated-link {
  position: relative;
}

a.animated-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

a.animated-link:hover::after {
  width: 100%;
}

/* ========================================
   SKELETON LOADERS
   ======================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-hover) 0%,
    var(--border) 20%,
    var(--bg-hover) 40%,
    var(--bg-hover) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.long { width: 100%; }

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
}

.skeleton-button {
  width: 100px;
  height: 40px;
  border-radius: var(--radius);
}

/* Skeleton Post Card */
.skeleton-post {
  padding: 1.5rem;
}

.skeleton-post .skeleton-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.skeleton-post .skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ========================================
   TOOLTIPS
   ======================================== */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

[data-tooltip]::after {
  content: '';
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border: 6px solid transparent;
  border-top-color: var(--text);
  margin-bottom: -12px;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip positions */
[data-tooltip-pos="bottom"]::before {
  bottom: auto;
  top: 100%;
  transform: translateX(-50%) translateY(-10px);
}

[data-tooltip-pos="bottom"]:hover::before {
  transform: translateX(-50%) translateY(5px);
}

[data-tooltip-pos="bottom"]::after {
  bottom: auto;
  top: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--text);
  margin-bottom: 0;
  margin-top: -12px;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.badge.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.badge.success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
}

.badge.warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
}

.badge.error {
  background: linear-gradient(135deg, var(--error), #dc2626);
  color: white;
}

.badge.new {
  animation: pulse 1.5s infinite;
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--error);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.3s ease;
}

.notification-badge.pulse {
  animation: pulse 1s infinite;
}

/* Online Status Badge */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  position: absolute;
  bottom: 0;
  right: 0;
}

.status-dot.online {
  background: var(--success);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: var(--text-muted);
}

.status-dot.busy {
  background: var(--error);
}

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--error);
  color: white;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ========================================
   PROGRESS BARS
   ======================================== */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

.progress-bar.success {
  background: linear-gradient(90deg, var(--success), #059669);
}

.progress-bar.warning {
  background: linear-gradient(90deg, var(--warning), #d97706);
}

.progress-bar.error {
  background: linear-gradient(90deg, var(--error), #dc2626);
}

/* ========================================
   TABS
   ======================================== */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-hover);
  padding: 0.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   DROPDOWN MENU
   ======================================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
}

.dropdown.active .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(5px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--bg), 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-dots {
  display: flex;
  gap: 0.5rem;
}

.loading-dots span {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 0.6s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.1s; }
.loading-dots span:nth-child(3) { animation-delay: 0.2s; }

/* ========================================
   STORIES CIRCLE
   ======================================== */
.story-avatar {
  position: relative;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--warning));
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.story-avatar:hover {
  transform: scale(1.1);
}

.story-avatar.viewed {
  background: var(--border);
}

.story-avatar img {
  display: block;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
}

/* ========================================
   FLOATING ACTION BUTTON
   ======================================== */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  z-index: 100;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.fab:active {
  transform: scale(0.95);
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================
   GLASSMORPHISM
   ======================================== */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   GRADIENT TEXT
   ======================================== */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   CONFETTI (for celebrations)
   ======================================== */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  animation: confetti 1s ease-out forwards;
}

/* ========================================
   SMOOTH PAGE TRANSITIONS
   ======================================== */
.page-enter {
  animation: fadeIn 0.3s ease;
}

.page-exit {
  animation: fadeIn 0.3s ease reverse;
}

/* ========================================
   PRINT
   ======================================== */
@media print {
  .topbar, .sidebar, .btn, form, .fab {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
