/* Styla video-feeden och overlays. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --secondary: #a855f7;
  --bg-dark: #000000;
  --text-light: #ffffff;
  --text-muted: #a0a0a0;
  --overlay-bg: rgba(0, 0, 0, 0.3);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

/* Styla topbaren i feeden. */
.feed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-light);
  font-size: 24px;
  font-weight: 700;
}

.logo-icon {
  font-size: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  gap: 15px;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
}

.category-filter-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.category-filter-select {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
}

.category-filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.user-btn,
.login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.user-btn {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.user-btn:hover {
  background: rgba(99, 102, 241, 0.2);
}

.login-btn {
  background: var(--primary);
  color: white;
}

.login-btn:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

/* Styla huvudcontainer for feeden. */
.feed-container {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* Styla varje videoyta i feeden. */
.video-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transform: translate3d(0, 100%, 0);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
  will-change: transform, opacity;
}

.video-item.is-active {
  opacity: 1;
  pointer-events: auto;
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Styla overlay ovanfor videon. */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 80px 20px 100px;
}

/* Styla textinfo for video och skapare. */
.video-info {
  pointer-events: auto;
  max-width: calc(100% - 100px);
}

.video-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  opacity: 0.9;
}

.video-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.video-description {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 12px;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--primary);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.view-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  opacity: 0.8;
}

/* Styla action-knappar pa hoger sida. */
.video-actions {
  position: absolute;
  right: 20px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  pointer-events: auto;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  backdrop-filter: blur(10px);
}

.action-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.7);
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn.active {
  background: var(--primary);
  color: white;
}

.action-btn svg {
  width: 30px;
  height: 30px;
}

.action-count,
.action-label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.like-btn,
.dislike-btn,
.save-btn,
.share-btn {
  width: auto;
  height: auto;
  min-width: 64px;
  padding: 10px 12px;
  border-radius: 28px;
}

.like-btn.active {
  background: rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.dislike-btn.active {
  background: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.save-btn.active {
  background: rgba(99, 102, 241, 0.9);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.action-btn.feedback-pop {
  animation: actionPop 220ms ease;
}

@keyframes actionPop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

/* Styla play/pause-knappen i mitten. */
.play-pause-btn {
  display: none !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.play-pause-btn:active {
  transform: translate(-50%, -50%) scale(0.9);
}

.play-pause-btn[data-state="playing"] .play-icon {
  display: none;
}

.play-pause-btn[data-state="playing"] .pause-icon {
  display: block;
}

.play-pause-btn[data-state="paused"] .play-icon {
  display: block;
}

.play-pause-btn[data-state="paused"] .pause-icon {
  display: none;
}

/* Styla progress-bar under videon. */
.video-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  overflow: hidden;
  z-index: 12;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.1s linear;
}

/* Styla pilar for upp och ner i feeden. */
.scroll-indicator {
  position: fixed;
  left: 16px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  /* animation: bounce 2s infinite;  */
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  visibility: hidden;
  /* transition:
    transform 0.2s ease,
    background 0.2s ease; */
}

.scroll-up {
  top: calc(50% - 58px);
}

.scroll-down {
  top: calc(50% + 10px);
}

.scroll-indicator:hover {
  background: rgba(0, 0, 0, 0.72);
  /* transform: scale(1.05); */
}
/* 
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
} */

/* Styla login-modal for gastanvandare. */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-content {
  background: #1e293b;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal-content h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Anpassa layout for mindre skarmar. */
@media (max-width: 768px) {
  .feed-header {
    padding: 0 16px;
  }

  .video-overlay {
    padding: 70px 16px 80px;
  }

  .video-info {
    max-width: calc(100% - 80px);
  }

  .video-actions {
    right: 16px;
    bottom: 100px;
    gap: 16px;
  }

  .action-btn {
    width: 48px;
    height: 48px;
  }

  .action-btn svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 20px !important;
    padding: 0 10px;

  .logo-icon {
    font-size: 28px !important;
  }


  .header-center {
    margin: 0 8px;
  }

  .category-filter-form {
    padding: 4px 8px;
    gap: 6px;
  }

  .category-filter-label {
    display: none;
  }

  .category-filter-select {
    max-width: 120px;
    font-size: 12px;
    padding: 3px 6px;
  }
  .video-title {
    font-size: 16px;
  }

  .video-description {
    font-size: 13px;
  }
}
