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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #a80000 0%, #150000 100%);
  background-attachment: fixed;
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 15px 0;
  margin-bottom: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}

.age-badge {
  background: #000000;
  color: #ff3333;
  padding: 5px 12px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 14px;
  border: 1px solid rgba(255, 50, 50, 0.4);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: #ff8080;
}

/* Age Warning Banner */
.age-warning {
  background: linear-gradient(135deg, rgba(180, 0, 0, 0.85) 0%, rgba(100, 0, 0, 0.9) 100%);
  border: 1px solid rgba(255, 100, 100, 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.age-icon {
  background: rgba(255, 255, 255, 0.2);
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.age-text {
  flex: 1;
}

.age-text strong {
  font-size: 18px;
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

.age-text p {
  font-size: 13.5px;
  opacity: 0.9;
  line-height: 1.3;
}

.user-banner-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-phone-badge {
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.95;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-logout {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  text-decoration: none;
  color: white;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* Category Tabs */
.category-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.tab {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 18px;
  text-decoration: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.tab:hover {
  background: rgba(40, 40, 40, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.tab.active {
  background: linear-gradient(135deg, #e60000 0%, #a30000 100%);
  border-color: rgba(255, 120, 120, 0.4);
  box-shadow: 0 6px 20px rgba(220, 0, 0, 0.45);
}

.tab span {
  font-size: 16px;
  font-weight: 700;
}

.tab .count {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  min-width: 32px;
  text-align: center;
}

/* Search */
.search-container {
  margin-bottom: 24px;
}

.search-container form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  background: rgba(15, 15, 15, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  color: #ffffff;
  font-size: 15px;
  backdrop-filter: blur(10px);
  outline: none;
  transition: all 0.2s;
  -webkit-appearance: none;
}

.search-input:focus {
  border-color: #ff3333;
  background: rgba(25, 25, 25, 0.85);
  box-shadow: 0 0 0 3px rgba(220, 0, 0, 0.25);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #e60000 0%, #a30000 100%);
  border: none;
  border-radius: 50px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(220, 0, 0, 0.35);
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 0, 0, 0.55);
}

.search-btn:active {
  transform: translateY(0);
}

/* Content Section */
.content-section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #ffffff;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: #ff2a2a;
  border-radius: 2px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 35px;
}

.content-card {
  background: rgba(15, 15, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  backdrop-filter: blur(8px);
}

.content-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 60, 60, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.content-card a {
  text-decoration: none;
  color: #ffffff;
  display: block;
}

.thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: #0d0d0d;
}

.thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.content-card:hover .thumbnail img {
  transform: scale(1.04);
}

.duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-info {
  padding: 12px 14px;
  background: transparent;
}

.card-info h3 {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* No Content */
.no-content {
  text-align: center;
  padding: 50px 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.no-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.no-content p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
}

/* Server Error State */
.no-content.server-error {
  border-color: rgba(255, 160, 0, 0.35);
  background: rgba(255, 120, 0, 0.08);
}

.no-content.server-error .error-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: pulse-warn 2s ease-in-out infinite;
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.no-content.server-error h2 {
  color: #ffaa00;
}

.no-content.server-error p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.no-content .error-sub {
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.45) !important;
}

.retry-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 26px;
  background: linear-gradient(135deg, #cc6600, #ff9900);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 30px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(255, 150, 0, 0.35);
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 150, 0, 0.5);
}

/* Video Player Container */
.video-container {
  background: rgba(15, 15, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.video-player {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  background: #000000;
}

.video-player video,
.video-player iframe {
  width: 100% !important;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto !important;
  min-height: 200px;
  max-height: 75vh;
  border: none;
  display: block;
  border-radius: 10px;
}

.video-info h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.video-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* Back Link */
.back-link {
  margin: 25px 0;
}

.back-link a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: all 0.2s;
}

.back-link a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-3px);
}

/* Footer */
.footer {
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 25px 15px;
  margin-top: 50px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.footer-content p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13.5px;
  margin: 4px 0;
}

/* =========================================================
   RESPONSIVE MEDIA QUERIES (MOBILE / TABLET / SMALL SCREENS)
   ========================================================= */

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .container {
    padding: 16px 14px;
  }

  .header {
    padding: 12px 0;
    margin-bottom: 18px;
  }

  .header-content {
    flex-direction: row;
    justify-content: space-between;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }

  .video-info h1 {
    font-size: 20px;
  }
}

/* Mobile Screens (<= 640px) */
@media (max-width: 640px) {
  .container {
    padding: 12px 10px;
  }

  /* Compact modern Age Warning Banner */
  .age-warning {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 14px;
    gap: 12px;
    border-radius: 14px;
    margin-bottom: 18px;
  }

  .age-warning-main {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .age-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 16px;
  }

  .age-text strong {
    font-size: 16px;
  }

  .age-text p {
    font-size: 12px;
  }

  .user-banner-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .user-phone-badge {
    font-size: 12px;
    padding: 4px 8px;
  }

  .btn-logout {
    padding: 5px 12px;
    font-size: 12px;
  }

  /* 2-Column Mobile Tabs */
  .category-tabs {
    gap: 8px;
    margin-bottom: 18px;
  }

  .tab {
    padding: 11px 12px;
    border-radius: 12px;
  }

  .tab span {
    font-size: 13.5px;
  }

  .tab .count {
    font-size: 11.5px;
    padding: 3px 7px;
    min-width: 26px;
    border-radius: 10px;
  }

  /* Search */
  .search-container {
    margin-bottom: 18px;
  }

  .search-input {
    padding: 10px 14px;
    font-size: 13.5px;
  }

  .search-btn {
    padding: 10px 16px;
    font-size: 13.5px;
  }

  .section-title {
    font-size: 18px;
    margin-bottom: 12px;
  }

  /* Clean 2-Column Mobile Grid for Cards */
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 25px;
  }

  .content-card {
    border-radius: 10px;
  }

  .duration {
    bottom: 5px;
    right: 5px;
    padding: 2px 5px;
    font-size: 9.5px;
    border-radius: 4px;
  }

  .card-info {
    padding: 8px 10px;
  }

  .card-info h3 {
    font-size: 12.5px;
    line-height: 1.3;
  }

  .video-container {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .video-info h1 {
    font-size: 18px;
  }
}

/* Very Small Mobile Screens (<= 360px) */
@media (max-width: 360px) {
  .container {
    padding: 10px 8px;
  }

  .tab {
    padding: 9px 8px;
  }

  .tab span {
    font-size: 12px;
  }

  .content-grid {
    gap: 8px;
  }

  .card-info {
    padding: 6px 8px;
  }

  .card-info h3 {
    font-size: 11.5px;
  }
}
