/* JustFun - RedGifs Style UI */
:root {
  --bg: #000000;
  --bg-sidebar: #0d0d0d;
  --bg-hover: #1a1a1a;
  --bg-active: #1f1f1f;
  --text: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #666666;
  --accent: #e53935;
  --accent-hover: #ff5252;
  --border: #1a1a1a;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ===== LEFT SIDEBAR - REDGIFS STYLE ===== */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.sidebar-logo {
  padding: 24px 20px 32px;
}

.sidebar-logo a {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--text);
  border-left-color: var(--accent);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Sidebar Footer - Legal Links */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.legal-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-link {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.legal-link:hover {
  color: var(--text-secondary);
}

/* ===== MAIN VIDEO AREA ===== */
.video-container {
  flex: 1;
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  background: var(--bg);
}

.video-container::-webkit-scrollbar {
  display: none;
}

/* ===== VIDEO SLIDE ===== */
.video-slide {
  height: 100vh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg);
}

.video-wrapper {
  position: relative;
  height: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-player {
  max-height: 100vh;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* ===== VIDEO INFO OVERLAY ===== */
.video-info {
  position: absolute;
  bottom: 100px;
  left: 24px;
  right: 120px;
  z-index: 10;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.video-creator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.creator-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff8a80);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.creator-name {
  font-weight: 600;
  font-size: 17px;
}

.creator-name:hover {
  text-decoration: underline;
}

.video-title {
  font-size: 15px;
  line-height: 1.5;
  max-width: 500px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.video-tag {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.video-tag:hover {
  color: var(--accent);
}

/* ===== RIGHT SIDE ACTIONS ===== */
.video-actions {
  position: absolute;
  right: 20px;
  bottom: 140px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 10;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s;
}

.action-btn:hover {
  transform: scale(1.1);
}

.action-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.15s;
}

.action-btn:hover .action-icon {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
}

.action-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.2);
  z-index: 20;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

/* ===== SCROLL HINT ===== */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  animation: bounce 2s infinite;
  z-index: 10;
}

.scroll-hint svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

/* ===== EXPLORE PAGE ===== */
.explore-container {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}

.explore-header {
  margin-bottom: 24px;
}

.explore-title {
  font-size: 28px;
  font-weight: 700;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.explore-card {
  aspect-ratio: 9/16;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.explore-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.explore-card img,
.explore-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.explore-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.explore-card-title {
  font-size: 13px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.explore-card-creator {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== LOGIN PAGE ===== */
.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 48px 40px;
  background: #111;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
  font-size: 15px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-btn {
  padding: 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}

.login-btn:hover {
  background: var(--accent-hover);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #333;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.login-footer a {
  color: var(--accent);
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ===== LEGAL PAGE ===== */
.legal-container {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 40px;
  background: var(--bg);
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.legal-section p,
.legal-section li {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-section ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-section a {
  color: var(--accent);
}

.legal-section a:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    width: 72px;
  }
  
  .sidebar-logo {
    padding: 20px 0;
    text-align: center;
  }
  
  .sidebar-logo a {
    font-size: 20px;
  }
  
  .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 16px 8px;
    font-size: 11px;
    text-align: center;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  
  .nav-item.active {
    border-left: none;
    border-bottom-color: var(--accent);
  }
  
  .sidebar-footer {
    padding: 12px 8px;
  }
  
  .legal-links {
    gap: 8px;
  }
  
  .legal-link {
    font-size: 10px;
    text-align: center;
  }
  
  .video-info {
    left: 16px;
    right: 80px;
    bottom: 120px;
  }
  
  .video-actions {
    right: 12px;
    bottom: 160px;
  }
  
  .action-icon {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }
}

@media (max-width: 600px) {
  .sidebar {
    width: 60px;
  }
  
  .sidebar-logo a {
    font-size: 16px;
  }
  
  .nav-item {
    padding: 12px 6px;
    font-size: 10px;
  }
  
  .nav-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* ===== HIDE DEFAULT ELEMENTS ===== */
.site-header,
.site-footer,
.tagbar {
  display: none !important;
}
