/* ==========================================================================
   KatDrama - Cineapse-Grade Minimalist Streaming Platform UI (PHP Edition)
   "Streaming, stripped back. With nothing in the way but the play button."
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-black: #000000;
  --bg-surface: #0a0a0a;
  --bg-card: #121212;
  --bg-card-hover: #1a1a1a;
  
  --text-white: #ffffff;
  --text-gray: #888888;
  --text-muted: #555555;

  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.3);

  --accent-red: #e50914;
  --accent-blue: #00a8ff;
  --accent-gold: #ffb703;
}

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-black);
  color: var(--text-white);
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background-color: var(--bg-black);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.quicksand {
  font-family: 'Quicksand', sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: #000000;
}

::-webkit-scrollbar-thumb {
  background: #262626;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #404040;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Quicksand', 'Inter', sans-serif;
  color: #ffffff;
  font-weight: 700;
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

/* Container */
.cineapse-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .cineapse-container {
    padding: 0 14px;
  }
}

@media (min-width: 768px) {
  .cineapse-container {
    padding: 0 48px;
  }
}

/* ==========================================================================
   Cineapse Navigation Links with Animated Underline
   ========================================================================== */
.cineapse-nav-link {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  color: var(--text-gray);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.25s ease;
  cursor: pointer;
}

.cineapse-nav-link:hover, .cineapse-nav-link.active {
  color: #ffffff;
}

.cineapse-nav-underline {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background-color: #ffffff;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cineapse-nav-link:hover .cineapse-nav-underline,
.cineapse-nav-link.active .cineapse-nav-underline {
  width: 100%;
}

/* ==========================================================================
   Cineapse Row Headers (with vertical rounded white bar)
   ========================================================================== */
.cineapse-row-title {
  font-size: 1.45rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  color: #ffffff;
  font-family: 'Quicksand', sans-serif;
}

.cineapse-vertical-bar {
  display: inline-block;
  width: 4px;
  height: 22px;
  background-color: #ffffff;
  margin-right: 12px;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* ==========================================================================
   Cineapse Full-Height Carousel Navigation Paddles
   ========================================================================== */
.cineapse-row-wrapper {
  position: relative;
  margin-bottom: 44px;
}

.cineapse-row-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

@media (max-width: 640px) {
  .cineapse-row-track {
    gap: 10px;
    padding-bottom: 10px;
  }
}

.cineapse-row-track::-webkit-scrollbar {
  display: none;
}

.cineapse-paddle-btn {
  position: absolute;
  top: 0;
  bottom: 16px;
  z-index: 20;
  width: 64px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}

.cineapse-row-wrapper:hover .cineapse-paddle-btn {
  opacity: 1;
}

.cineapse-paddle-btn.left {
  left: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.92) 0%, transparent 100%);
  justify-content: flex-start;
  padding-left: 10px;
}

.cineapse-paddle-btn.right {
  right: 0;
  background: linear-gradient(270deg, rgba(0,0,0,0.92) 0%, transparent 100%);
  justify-content: flex-end;
  padding-right: 10px;
}

@media (max-width: 768px) {
  .cineapse-paddle-btn {
    display: none !important;
  }
}

/* ==========================================================================
   Cineapse Provider Card Styles
   ========================================================================== */
.provider-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease;
}

.provider-item:hover {
  transform: translateY(-3px);
}

.provider-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #121212;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (min-width: 768px) {
  .provider-icon-box {
    width: 84px;
    height: 84px;
  }
}

.provider-item:hover .provider-icon-box {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   Cineapse Media Card (Rounded, Fast, Minimal)
   ========================================================================== */
.cineapse-card {
  position: relative;
  min-width: 172px;
  width: 172px;
  flex-shrink: 0;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 640px) {
  .cineapse-card {
    min-width: 136px;
    width: 136px;
  }
}

@media (min-width: 768px) {
  .cineapse-card {
    min-width: 185px;
    width: 185px;
  }
}

.cineapse-card:hover {
  transform: scale(1.05);
}

.cineapse-poster-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

.cineapse-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.cineapse-card:hover .cineapse-poster-img {
  transform: scale(1.04);
}

.cineapse-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 10px;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 10;
  pointer-events: none;
}

.cineapse-card:hover .cineapse-play-overlay,
.cineapse-poster-box:hover .cineapse-play-overlay,
.cineapse-movie-card:hover .cineapse-play-overlay {
  opacity: 1;
}

.cineapse-play-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding-left: 3px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.cineapse-card:hover .cineapse-play-icon,
.cineapse-poster-box:hover .cineapse-play-icon,
.cineapse-movie-card:hover .cineapse-play-icon {
  transform: scale(1.05);
}

.cineapse-hover-title {
  color: #ffffff;
  font-family: 'Quicksand', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  margin-top: 10px;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.cineapse-hover-meta {
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.cineapse-hover-meta .hover-star {
  color: #ffb703;
  font-size: 11px;
}

.cineapse-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Quicksand', sans-serif;
}

.cineapse-card-meta {
  font-size: 0.75rem;
  color: #888888;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

/* ==========================================================================
   Cinema Player (Cineapse Stripped-Back Style)
   ========================================================================== */
.cineapse-player-wrapper {
  position: relative;
  width: 100%;
  background: #000000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95);
}

.cineapse-player-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Filter pills */
.cineapse-pill {
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cineapse-pill:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
  background: #1a1a1a;
}

.cineapse-pill.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* ==========================================================================
   Responsive Community Comments & Reviews (Mobile / Tablet / PC)
   ========================================================================== */
.community-comments-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.community-comment-card {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.community-comment-card:hover {
  border-color: rgba(255, 42, 85, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.comment-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 42, 85, 0.12);
  border: 1px solid rgba(255, 42, 85, 0.3);
  color: #ff4d6d;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  font-family: 'Quicksand', sans-serif;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.comment-card-badge:hover {
  background: rgba(255, 42, 85, 0.25);
  border-color: #ff4d6d;
}

.comment-card-date {
  font-size: 0.72rem;
  color: #71717a;
  flex-shrink: 0;
  white-space: nowrap;
}

.comment-card-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-card-username {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Quicksand', sans-serif;
  line-height: 1.2;
}

.comment-card-tag {
  font-size: 0.68rem;
  color: #10b981;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-card-text {
  font-size: 0.84rem;
  color: #d4d4d8;
  line-height: 1.55;
  margin: 0;
  font-family: 'Inter', sans-serif;
  word-break: break-word;
}

.comment-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}

.comment-card-watch-link {
  font-size: 0.76rem;
  color: #00a8ff;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.comment-card-watch-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* Tablet (641px - 1024px) */
@media (max-width: 1024px) {
  .community-comments-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
}

/* Mobile (<= 640px) */
@media (max-width: 640px) {
  .community-comments-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .community-comment-card {
    padding: 14px 16px !important;
    border-radius: 14px !important;
  }
  .comment-card-badge {
    max-width: 70% !important;
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
  }
  .comment-card-text {
    font-size: 0.82rem !important;
  }
  .comment-card-footer {
    font-size: 0.72rem !important;
  }
}

/* ==========================================================================
   Responsive Modern Footer (Mobile / Tablet / PC)
   ========================================================================== */
.cineapse-footer-main {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 56px;
  background: #000000;
  color: #a1a1aa;
}

.cineapse-footer-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 48px 24px 36px;
}

.cineapse-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: start;
}

.cineapse-footer-bottom {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cineapse-footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #71717a;
  font-family: 'Quicksand', sans-serif;
}

.cineapse-footer-nav a {
  transition: color 0.2s ease;
}

.cineapse-footer-nav a:hover {
  color: #ffffff;
}

@media (max-width: 900px) {
  .cineapse-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .cineapse-footer-container {
    padding: 36px 16px 28px;
  }
  .cineapse-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .cineapse-footer-nav {
    gap: 14px;
    font-size: 0.76rem;
  }
}

/* ==========================================================================
   Universal Mobile & Tablet Compatibility Enhancements
   ========================================================================== */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
  }

  .cineapse-container {
    padding: 0 14px !important;
  }

  .cineapse-row-title {
    font-size: 1.15rem !important;
  }

  .cineapse-vertical-bar {
    height: 18px !important;
    width: 3.5px !important;
    margin-right: 8px !important;
  }

  .cineapse-row-track {
    gap: 10px !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
  }

  .cineapse-card {
    min-width: 130px !important;
    width: 130px !important;
  }

  .cineapse-card-title {
    font-size: 0.8rem !important;
  }

  .cineapse-card-meta {
    font-size: 0.7rem !important;
  }

  .cineapse-paddle-btn {
    display: none !important; /* Hide carousels paddles on touch devices */
  }

  /* Comments section: Horizontal side-by-side row on mobile like PC */
  .community-comments-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    gap: 14px !important;
    width: 100% !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding-bottom: 12px !important;
    padding-top: 4px !important;
  }

  .community-comments-grid::-webkit-scrollbar {
    display: none !important;
  }

  .community-comment-card {
    flex: 0 0 290px !important;
    width: 290px !important;
    min-width: 290px !important;
    max-width: 290px !important;
    scroll-snap-align: start !important;
    padding: 16px 18px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  .comment-card-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  .comment-card-badge {
    max-width: 65% !important;
    font-size: 0.74rem !important;
    padding: 3px 8px !important;
  }

  .comment-card-username {
    font-size: 0.82rem !important;
    max-width: 140px !important;
  }

  .comment-card-text {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
  }

  .comment-card-footer {
    font-size: 0.72rem !important;
  }

  /* Make Hero and social buttons fit mobile screens perfectly */
  .hero-social-btns {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .hero-social-btn {
    padding: 8px 14px !important;
    font-size: 0.78rem !important;
  }
}

