/* ==========================================================================
   XDRIVE CLOUD GALLERY - COMPONENT STYLES
   ========================================================================== */

/* Navigation Links */
.logo-link {
  text-decoration: none;
  color: inherit;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-link-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-btn.active {
  color: #080c15;
  background: var(--primary-gradient);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.35);
}

/* Gallery Hero & Stats */
.gallery-hero {
  padding: 40px 0 25px;
}

.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 20px;
}

.gallery-title {
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.gallery-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

#folder-badge {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-video {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
}

.icon-storage {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
}

.icon-cloud {
  background: rgba(66, 133, 244, 0.12);
}

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toolbar */
.toolbar-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 25px 0 20px;
  padding: 12px 18px;
  background: rgba(13, 20, 36, 0.7);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.search-input-wrapper {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-dark);
}

.search-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  font-size: 18px;
  cursor: pointer;
}

.clear-btn:hover {
  color: #fff;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 13px;
  color: var(--text-muted);
}

.sort-select {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.view-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 2px;
  border: 1px solid var(--border-subtle);
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.toggle-btn:hover {
  color: #fff;
}

.toggle-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-cyan);
}

/* Quick Filter Chips */
.gallery-filter-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.gallery-filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.filter-chip.active {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

/* Camera Shutter Flash Animation */
.camera-shutter-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  pointer-events: none;
  z-index: 99;
  border-radius: inherit;
  animation: cameraShutterFade 0.45s ease-out forwards;
}

@keyframes cameraShutterFade {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Gallery Container */
.gallery-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

.empty-gallery {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 48px;
}

.empty-gallery h3 {
  font-size: 20px;
}

.empty-gallery p {
  color: var(--text-muted);
  margin-bottom: 12px;
  max-width: 460px;
}

/* Video Grid Cards */
.video-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.gallery-card {
  background: rgba(16, 24, 40, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 242, 254, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 254, 0.12);
}

.card-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.gallery-card:hover .card-play-overlay {
  opacity: 1;
}

.play-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.85);
  color: #080c15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px var(--accent-cyan);
  transform: scale(0.85);
  transition: var(--transition);
}

.gallery-card:hover .play-circle {
  transform: scale(1);
}

.card-badge-top-left {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 242, 254, 0.85);
  color: #080c15;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.card-badge-bottom-right {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #e2e8f0;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dark);
}

.card-size {
  color: var(--accent-cyan);
  font-weight: 600;
}

.card-actions-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.btn-card-play {
  width: 100%;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15) 0%, rgba(79, 172, 254, 0.15) 100%);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.35);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-card-play:hover {
  background: var(--primary-gradient);
  color: #080c15;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.card-icon-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.btn-card-icon {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-card-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-card-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* List View Style */
.video-cards-grid.list-view {
  grid-template-columns: 1fr;
}

.video-cards-grid.list-view .gallery-card {
  flex-direction: row;
  height: 110px;
}

.video-cards-grid.list-view .card-media-wrapper {
  width: 180px;
  height: 100%;
  aspect-ratio: auto;
}

.video-cards-grid.list-view .card-body {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.video-cards-grid.list-view .card-actions-row {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
  display: flex;
}

/* Cinema Modal Player */
.cinema-card {
  width: 100%;
  max-width: 980px;
  border-radius: var(--radius-lg);
  padding: 22px;
  background: rgba(11, 16, 28, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 242, 254, 0.15);
}

.cinema-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.cinema-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.cinema-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.cinema-title-text-wrap {
  min-width: 0;
  flex: 1;
}

.cinema-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.cinema-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-indicator-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #080c15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.cinema-title {
  font-size: 16px;
  font-weight: 700;
}

.cinema-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.cinema-badge {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.cinema-date {
  font-size: 12px;
  color: var(--text-dark);
}

.cinema-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-mode-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.mode-btn.active {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  font-weight: 600;
}

.player-screen-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.native-player, .drive-iframe {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: #000;
}

.cinema-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.cinema-nav-group, .cinema-links-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Delete Card Modal */
.delete-card {
  max-width: 440px;
  text-align: center;
  padding: 30px 24px;
}

.delete-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.delete-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.delete-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 22px;
}

.delete-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-confirm-delete-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: #fff;
}

.btn-confirm-delete-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: var(--danger);
  color: #fff;
}

/* Spin animation for refresh */
.spinning {
  animation: spin 0.8s linear infinite;
}

/* Integrated In-Page Theater Player */
.integrated-player-section {
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 242, 254, 0.12);
  margin-bottom: 30px;
  overflow: hidden;
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

.player-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 16px;
  flex-wrap: wrap;
}

.player-info-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.now-playing-pill {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 8px #00f2fe;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.int-video-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.int-video-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-quick-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-capture {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}

.btn-capture:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
}

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

.int-video-container {
  position: relative;
  width: 100%;
  max-height: 560px;
  background: #050811;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.integrated-video {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  outline: none;
  background: #000;
}

.int-player-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 16px;
  flex-wrap: wrap;
}

.player-nav-buttons, .player-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timestamp-extractor-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.extractor-label {
  font-size: 12px;
  color: var(--text-muted);
}

.input-with-button {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thumb-sec-input {
  width: 65px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  color: #00f2fe;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: monospace;
  text-align: center;
  font-size: 13px;
  outline: none;
}

.thumb-sec-input:focus {
  border-color: var(--accent-cyan);
}

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

/* Card thumbnail image fix */
.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  background: #080c15;
}

/* ==========================================================================
   GALLERY MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */
@media (max-width: 820px) {
  .hero-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-input-wrapper {
    max-width: 100%;
  }

  .cinema-footer, .int-player-bottom-bar {
    flex-direction: column;
    gap: 12px;
  }

  .cinema-nav-group, .cinema-links-group, .player-nav-buttons, .player-links {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  /* Safe Area & Bottom Nav Padding */
  .main-content {
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
  }

  /* Compact Sticky Mobile Header */
  .app-header {
    position: sticky;
    top: 0;
    z-index: 80;
    padding: 10px 0;
    background: rgba(8, 12, 21, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .brand-tag {
    display: none;
  }

  .nav-links {
    display: none; /* Handled smoothly by mobile bottom nav bar */
  }

  .header-actions {
    gap: 6px;
  }

  #btn-refresh-gallery {
    padding: 6px 10px;
    height: 32px;
    font-size: 11px;
  }

  #btn-refresh-gallery span {
    display: none; /* Icon only on mobile header */
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 11px;
    height: 32px;
  }

  .status-pill span:not(.status-indicator) {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Hero Section */
  .gallery-hero {
    padding: 16px 0 10px 0;
  }

  .gallery-title {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 8px;
  }

  .gallery-subtitle {
    font-size: 12px;
    line-height: 1.5;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 18px;
  }

  .stat-card {
    padding: 10px 12px;
  }

  .stat-number {
    font-size: 18px;
  }

  /* Toolbar */
  .toolbar-section {
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
  }

  .filter-group {
    flex-wrap: wrap;
    gap: 8px;
  }

  .filter-select, .sort-select {
    flex: 1;
    min-width: 130px;
    font-size: 16px !important; /* Prevents iOS auto-zoom */
  }

  .view-toggle-group {
    display: none; /* Standard 1-col card grid on mobile */
  }

  /* Video Cards Grid */
  .video-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-card {
    border-radius: var(--radius-md);
  }

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-actions-row {
    margin-top: 10px;
    padding-top: 10px;
  }

  .btn-play-card {
    height: 38px;
    font-size: 13px;
  }

  .btn-card-icon {
    height: 38px;
  }

  /* Hide top in-page player on mobile so watching video never jumps to top */
  #integrated-player-section {
    display: none !important;
  }

  /* Cinema Player Modal (Bottom Sheet on Mobile) */
  .cinema-card {
    border-radius: 24px 24px 0 0;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 16px 14px calc(24px + env(safe-area-inset-bottom, 0px)) 14px;
    animation: slideUpSheet 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: none;
    box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.85);
    overflow-y: auto;
  }

  .cinema-card::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: -6px auto 14px auto;
  }

  .cinema-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .cinema-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .cinema-title-group {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  .cinema-video-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 110px);
  }

  .cinema-meta-row {
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
  }

  .cinema-card .close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  .cinema-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .cinema-tools-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
  }

  .cinema-tools-group .btn {
    padding: 5px 8px;
    font-size: 11px;
    flex: 1;
    justify-content: center;
  }

  .player-mode-switch {
    margin-left: auto;
  }

  .mode-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .player-screen-container {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .native-player {
    width: 100%;
    max-height: 48vh;
    object-fit: contain;
  }

  .cinema-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .cinema-nav-group {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  .cinema-nav-group .btn {
    flex: 1;
    justify-content: center;
    height: 42px;
    font-size: 13px;
    font-weight: 600;
  }

  .cinema-links-group {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .cinema-links-group .btn {
    flex: 1;
    justify-content: center;
    height: 38px;
    font-size: 12px;
    padding: 6px;
  }
}

@media (max-width: 400px) {
  .gallery-title {
    font-size: 20px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
