/* 
  Apple Design Style Theme for MacCMS v10
  Features: Frosted Glass, Large Titles, Rounded Corners, Soft Shadows, Dark Mode
*/

:root {
  /* Colors - Light Theme (Apple Style) */
  --bg-color: #F2F2F7;
  --bg-secondary: #FFFFFF;
  --text-primary: #000000;
  --text-secondary: #8E8E93;
  --text-tertiary: #C7C7CC;
  
  --accent-color: #007AFF; /* Apple Blue */
  --accent-hover: #0056b3;
  
  --card-bg: #FFFFFF;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.1);
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  --nav-height: 56px;
  --tabbar-height: 83px; /* iOS standard with safe area */
}

/* Dark Mode Override */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #000000;
    --bg-secondary: #1C1C1E;
    --text-primary: #FFFFFF;
    --text-secondary: #EBEBF599; /* 60% white */
    --text-tertiary: #EBEBF54D; /* 30% white */
    
    --accent-color: #0A84FF;
    --accent-hover: #409CFF;
    
    --card-bg: #1C1C1E;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
  }
}

/* CSS Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: var(--tabbar-height); /* Space for mobile tab bar */
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0; /* PC no tab bar */
  }
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* Typography - Large Titles */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.5px;
}

.large-title {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.8px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin: var(--spacing-lg) 0 var(--spacing-sm) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title .more {
  font-size: 15px;
  color: var(--accent-color);
  font-weight: 500;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 767px) {
  .grid-cols-3, .grid-cols-4, .grid-cols-5, .grid-cols-6 {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
  }
}

/* Frosted Glass Utilities */
.frosted-glass {
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--glass-border);
}

/* Header Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color 0.3s;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.nav-links {
  display: none;
  gap: var(--spacing-lg);
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.search-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  background: rgba(128,128,128,0.1);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* Mobile Bottom Tab Bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tabbar-height);
  z-index: 100;
  display: flex;
  justify-content: space-around;
  padding-top: 8px;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  border-top: 0.5px solid var(--glass-border);
  border-bottom: none;
}

@media (min-width: 768px) {
  .tab-bar {
    display: none;
  }
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  gap: 4px;
  width: 60px;
}

.tab-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.tab-item.active {
  color: var(--accent-color);
}

/* Movie Cards */
.vod-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.vod-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.vod-pic {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.vod-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vod-card:hover .vod-pic img {
  transform: scale(1.05);
}

.vod-label {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
}

.vod-info {
  padding: var(--spacing-sm);
}

.vod-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.vod-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search Bar */
.search-container {
  padding: var(--spacing-md) 0;
}

.search-input-wrapper {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  box-shadow: var(--card-shadow);
}

.search-input-wrapper input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  margin-left: 8px;
}

/* Detail Page Header (Immersive) */
.detail-header {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
}

.detail-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  filter: blur(30px) saturate(1.5);
  transform: scale(1.1);
  z-index: 1;
}

.detail-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(var(--bg-color-rgb), 0.2) 0%, var(--bg-color) 100%);
}

.detail-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-bottom: var(--spacing-xl);
}

.detail-info-flex {
  display: flex;
  gap: var(--spacing-lg);
  align-items: flex-end;
}

.detail-poster {
  width: 140px;
  aspect-ratio: 2/3;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.detail-text {
  flex: 1;
}

.detail-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.detail-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 100px; /* Fully rounded for Apple style */
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--card-shadow);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

/* Player Area */
.player-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: var(--spacing-lg);
}

.player-box {
  width: 100%;
  height: 100%;
}

/* Episodes List */
.episodes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.episode-btn {
  background: var(--bg-secondary);
  padding: 10px;
  text-align: center;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.2s;
}

.episode-btn:hover {
  background: rgba(128,128,128,0.1);
}

.episode-btn.active {
  background: var(--accent-color);
  color: #fff;
}

/* Utility */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

/* Scroll padding for anchors */
html {
  scroll-padding-top: var(--nav-height);
}
