/* Reels Styles - Instagram/TikTok inspired design */
header, footer, .menu-footer-fixed {
  display: none !important;
}

body {
  overflow: hidden;
}
.reels-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  margin-left: calc(-50vw + 50%);
}

.reels-feed {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.reels-feed::-webkit-scrollbar {
  display: none;
}

.reel-item {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  background: #000;
}

.reel-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-video {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

.back-button-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
}

#back-btn {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 15px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#back-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

#back-btn i {
  font-size: 16px;
}

.reel-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  z-index: 10;
}

.play-pause-btn,
.mute-unmute-btn {
  background: rgba(0, 0, 0, 0.7) !important;
  border: none !important;
  border-radius: 8px !important;
  width: 45px !important;
  height: 45px !important;
  color: white !important;
  font-size: 16px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mute-unmute-btn.audio-active {
  background: rgba(255, 48, 64, 0.8) !important;
  color: white !important;
}

.mute-unmute-btn.audio-muted {
  background: rgba(128, 128, 128, 0.8) !important;
  color: #ccc !important;
}

.play-pause-btn:hover,
.mute-unmute-btn:hover {
  background: rgba(0, 0, 0, 0.9) !important;
  transform: scale(1.05) !important;
}

.mute-unmute-btn.audio-active:hover {
  background: rgba(255, 48, 64, 1) !important;
}

.reel-info {
  position: absolute;
  bottom: 80px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 10;
}

.reel-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.profile-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid white;
  flex-shrink: 0;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-details h3 {
  color: white;
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.view-profile-btn {
  background: var(--rosa);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-top: 5px;
  display: inline-block;
}

.view-profile-btn:hover {
  background: var(--dourado);
  transform: scale(1.05);
  color: white;
  text-decoration: none;
}

.reel-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.action-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.like-btn.liked {
  background: var(--vermelho);
  color: white;
}

/* Estilos para o contador de likes */
.like-count {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  display: block;
  text-align: center;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.action-btn.like-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.action-btn.like-btn i {
  font-size: 24px;
}

.action-btn.like-btn.liked i {
  color: #ff3040 !important;
  animation: heartBeat 0.6s ease-in-out;
}

.action-btn.like-btn.liked .like-count {
  color: #ff3040;
}

.reel-navigation {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 20;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reel-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  z-index: 20;
}

.progress-bar {
  height: 100%;
  background: var(--dourado);
  width: 0%;
  transition: width 0.3s ease;
}

.no-videos {
  color: white;
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.no-videos h3 {
  margin-bottom: 20px;
  font-size: 24px;
}

.no-videos p {
  margin-bottom: 30px;
  font-size: 16px;
  opacity: 0.8;
}

/* Loading indicator */
.reel-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
}

.loading-spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid var(--dourado);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Loading States */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: white;
  z-index: 20;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ff1744;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.infinite-loading {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: white;
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 25px;
  border-radius: 25px;
  z-index: 1000;
}

.infinite-loading .loading-spinner {
  width: 30px;
  height: 30px;
  border-width: 2px;
}

.end-of-videos {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  background: rgba(0, 0, 0, 0.8);
  padding: 20px 30px;
  border-radius: 15px;
  z-index: 1000;
}

.end-of-videos h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.end-of-videos p {
  margin: 0 0 15px 0;
  font-size: 14px;
  opacity: 0.8;
}

/* Profile location */
.profile-location {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* Like count */
.like-count {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  display: block;
  text-align: center;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Liked state */
.like-btn.liked i {
  color: #ff3040 !important;
  animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Performance optimizations */
.reel-video {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.reel-item {
  contain: layout style paint;
  will-change: transform;
}

/* Preload indicator */
.reel-item[data-preload="true"] .reel-video {
  background: linear-gradient(45deg, #333, #444, #333);
  background-size: 200% 200%;
  animation: preloadShimmer 1.5s ease-in-out infinite;
}

@keyframes preloadShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Toast notifications */
.toast-message {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Smooth scrolling for better performance */
.reels-feed {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Optimized video loading states */
.reel-video[preload="auto"] {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}

.reel-video[preload="none"] {
  background: #000;
}

/* Connection-aware loading */
@media (prefers-reduced-motion: reduce) {
  .reels-feed {
    scroll-behavior: auto;
  }
  
  .loading-spinner {
    animation: none;
  }
  
  .like-btn.liked i {
    animation: none;
  }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .video-loading {
    gap: 10px;
  }
  
  .loading-spinner {
    width: 30px;
    height: 30px;
    border-width: 2px;
  }
  
  .infinite-loading {
    bottom: 80px;
    padding: 12px 20px;
  }
  
  .end-of-videos {
    bottom: 80px;
    padding: 15px 25px;
  }
}

/* Responsividade */
@media (max-width: 768px) {
  .reel-info {
    bottom: 60px;
    left: 15px;
    right: 15px;
  }
  
  .profile-image {
    width: 40px;
    height: 40px;
  }
  
  .profile-details h3 {
    font-size: 14px;
  }
  
  .view-profile-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .action-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .reel-navigation {
    right: 15px;
  }
  
  .nav-btn {
    width: 45px;
    height: 45px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .reel-info {
    align-items: flex-start;
    gap: 15px;
  }

  .reel-actions {
    align-self: flex-end;
    gap: 10px;
  }
  
  .action-btn {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  .reel-navigation {
    right: 10px;
    gap: 10px;
  }
  
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 12px;
  }
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.reel-item.active {
  animation: fadeIn 0.5s ease;
}

.reel-info {
  animation: slideUp 0.6s ease;
}

/* Esconder elementos da página principal */
.reels-page header, 
.reels-page footer, 
.reels-page .menu-footer-fixed {
  display: none !important;
}

.reels-page body {
  overflow: hidden;
}

.reels-page .row {
  background: transparent;
}

/* Touch gestures indicators */
.touch-indicator {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-align: center;
  z-index: 5;
  pointer-events: none;
  animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* Volume control */
.volume-control {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
}

.volume-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.volume-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.volume-btn.muted {
  background: rgba(255, 0, 0, 0.3);
}

/* Video quality indicator */
.quality-indicator {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  z-index: 10;
}

/* Error handling */
.video-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  z-index: 10;
}

.video-error i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.6;
}

.video-error p {
  margin: 0;
  font-size: 16px;
  opacity: 0.8;
}

/* Indicador visual de preferência salva */
.mute-unmute-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  border: 2px solid white;
  opacity: 0.8;
}

/* Overlay para o último vídeo */
.last-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 70%, rgba(0,0,0,0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 40px 20px;
  z-index: 15;
  opacity: 0;
  animation: fadeInOverlay 1s ease-in-out 2s forwards;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.last-video-message {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.last-video-message h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.last-video-message p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 20px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.last-video-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.last-video-btn {
  background: linear-gradient(135deg, #ff3040, #ff6b7a);
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 48, 64, 0.3);
  text-shadow: none;
}

.last-video-btn.secondary {
  background: linear-gradient(135deg, #666, #888);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.last-video-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 48, 64, 0.4);
}

.last-video-btn.secondary:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.last-video-btn i {
  font-size: 16px;
}

/* Indicador de vídeo visualizado */
.viewed-indicator {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  padding: 2px 4px;
  border-radius: 8px;
  font-size: 11px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
}

.viewed-indicator.viewed {
  background: rgba(108, 117, 125, 0.9);
  color: white;
}

.viewed-indicator.new {
  background: rgba(40, 167, 69, 0.9);
  color: white;
}

/* Sobreposição sutil para vídeos visualizados */
.reel-item.viewed .reel-video-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
  z-index: 1;
}

/* Animação de pulso para chamar atenção */
.last-video-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
  .last-video-message h3 {
    font-size: 20px;
  }
  
  .last-video-message p {
    font-size: 14px;
  }
  
  .last-video-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .last-video-btn {
    width: 100%;
    justify-content: center;
  }
}
