/* =========================================
   CORE STYLES & VARIABLES (YOUR EXACT THEME)
   ========================================= */
:root {
  --bg: #f5f7fa; 
  --card: #ffffff; 
  --text: #1a1a1a; 
  --text-muted: #666666;
  --border: #e1e4e8; 
  --accent: #4a4a4a; 
  --accent-light: #f3f4f6;
  --live-red: #ff3b30;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04); 
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.08);
  
  /* Sidebar Dimensions */
  --sidebar-collapsed: 80px;
  --sidebar-expanded: 260px;
  --header-height: 64px;
  --transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, sans-serif; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); overflow-x: hidden; }

/* FIX FOR GIANT SVGs */
svg {
  max-width: 100%;
  height: auto;
}

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

/* =========================================
   MOBILE HEADER
   ========================================= */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
  background: var(--card); border-bottom: 1px solid var(--border); z-index: 90;
  align-items: center; padding: 0 20px; justify-content: space-between;
}
.menu-toggle {
  background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center; padding: 8px; margin-left: -8px; border-radius: 8px;
}
.menu-toggle:hover { background: var(--accent-light); }
.menu-toggle svg { width: 24px; height: 24px; }
.mobile-logo { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }

/* =========================================
   SIDEBAR (Desktop Expand-on-Hover)
   ========================================= */
.sidebar {
  background: var(--card); border-right: 1px solid var(--border); position: fixed;
  top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; z-index: 100;
  transition: width var(--transition), transform var(--transition); overflow: hidden; white-space: nowrap;
}

/* Sidebar Top (For mobile close button) */
.sidebar-top {
  display: none; padding: 16px; justify-content: flex-end;
}
.close-sidebar { background: none; border: none; cursor: pointer; color: var(--text-muted); }

/* Sidebar Navigation */
.sidebar-nav { padding: 24px 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-link {
  display: flex; align-items: center; padding: 12px 0; margin: 0 12px;
  border-radius: var(--radius-md); text-decoration: none; color: var(--text-muted);
  font-weight: 600; font-size: 15px; transition: all 0.2s ease;
}
.nav-icon-wrapper { width: 56px; min-width: 56px; display: flex; align-items: center; justify-content: center; }
.nav-link svg { width: 22px; height: 22px; stroke-width: 2px; }
.nav-text { opacity: 0; transition: opacity 0.2s; }
.nav-link:hover { background: var(--accent-light); color: var(--text); }
.nav-link.active { background: var(--text); color: var(--card); }
.nav-link.active svg { color: var(--card); }

/* Live Indicator in Menu */
.live-badge {
  margin-left: auto; background: rgba(255, 59, 48, 0.1); color: var(--live-red);
  font-size: 11px; padding: 4px 8px; border-radius: 20px; font-weight: 800;
  display: flex; align-items: center; gap: 6px; margin-right: 12px;
}
.live-dot-small { width: 6px; height: 6px; background: var(--live-red); border-radius: 50%; animation: pulse 2s infinite; }

/* Sidebar Footer */
.sidebar-footer {
  height: 80px; display: flex; align-items: center; padding: 0 22px; border-top: 1px solid var(--border);
  margin-top: auto; 
}
.brand-avatar {
  width: 36px; height: 36px; min-width: 36px; background: linear-gradient(135deg, var(--accent), #888888);
  border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; margin-left: 12px; opacity: 0; transition: opacity 0.2s; }

/* Hover Rules for Desktop Sidebar & LAYOUT OVERLAP FIX */
@media (min-width: 769px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar:hover { width: var(--sidebar-expanded); box-shadow: var(--shadow-hover); }
  .sidebar:hover .brand-name, .sidebar:hover .nav-text { opacity: 1; transition-delay: 0.1s; }
  
  .main-content { 
    margin-left: var(--sidebar-collapsed); 
    width: calc(100% - var(--sidebar-collapsed));
    transition: margin-left var(--transition), width var(--transition); 
  }
}

.sidebar-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
  z-index: 95; opacity: 0; pointer-events: none; transition: opacity var(--transition);
}

/* =========================================
   MAIN CONTENT AREA (HOME DASHBOARD)
   ========================================= */
.main-content { 
  flex: 1; 
  padding: 40px; 
}

/* Added wrapper from earlier fix to keep content centered */
.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.welcome-banner {
  background: linear-gradient(135deg, var(--text), var(--accent)); border-radius: var(--radius-lg);
  padding: 40px; color: white; margin-bottom: 32px; box-shadow: var(--shadow-hover);
}
.welcome-banner h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.welcome-banner p { font-size: 16px; opacity: 0.9; max-width: 600px; line-height: 1.6; }

.section-title { font-size: 20px; font-weight: 800; margin-bottom: 20px; color: var(--text); }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

/* Action Cards (Home Page) */
.action-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; text-decoration: none; color: var(--text); display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition); position: relative;
}
.action-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #d1d5db; }
.card-icon-wrapper {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
}
.card-icon-wrapper.live-bg { background: rgba(255, 59, 48, 0.1); color: var(--live-red); }
.card-icon-wrapper.standard-bg { background: var(--accent-light); color: var(--text); }
.card-icon-wrapper svg { width: 28px; height: 28px; }
.action-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.action-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* LOCKED STATE STYLES (Home Page) */
.action-card.locked { background: #fafafa; color: #999; border-color: #eaeaea; cursor: not-allowed; pointer-events: none; }
.action-card.locked:hover { transform: none; box-shadow: var(--shadow-sm); }
.action-card.locked .card-icon-wrapper { background: #eee; color: #aaa; }
.lock-badge {
  position: absolute; top: 24px; right: 24px; background: #f0f0f0; color: #666;
  padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* =========================================
   VOD PAGE SPECIFIC STYLES (Picture Cards)
   Mapped entirely to your original theme colors
   ========================================= */

.video-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  gap: 24px; 
}

.video-card {
  background: var(--card); 
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); 
  overflow: hidden;
  display: flex; 
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--text);
  position: relative;
}

.video-card:hover { 
  transform: translateY(-4px); 
  box-shadow: var(--shadow-hover); 
  border-color: #d1d5db;
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--accent-light);
  position: relative;
}
.video-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}

.video-details {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.video-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vod-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.vod-meta svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
}
.exp-alert {
  color: var(--live-red);
  font-weight: 700;
  margin-top: 4px;
}
.exp-alert svg {
  stroke: var(--live-red);
}

.video-bottom-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
}

.btn-watch {
  background: var(--text); /* Uses your dark gray text color */
  color: var(--card); /* Uses your white card background color */
  padding: 10px 24px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
  text-decoration: none;
  display: inline-block;
}
.video-card:hover .btn-watch { opacity: 0.8; }

/* VOD LOCKED / EXPIRED STATE */
.video-card.locked { opacity: 0.6; pointer-events: none; }
.video-card.locked img { filter: grayscale(100%); }
.video-card.locked .btn-watch { background: #e1e4e8; color: #999; }

.lock-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px; gap: 8px; z-index: 10;
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 1024px) { 
  .main-content { padding: 32px; } 
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar-top { display: flex; } 
  .sidebar { width: var(--sidebar-expanded); transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .sidebar .brand-name, .sidebar .nav-text { opacity: 1; }
  .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
  
  .main-content { 
    margin-left: 0; 
    width: 100%;
    padding: calc(var(--header-height) + 24px) 20px 40px 20px; 
  }
  
  .welcome-banner { padding: 32px 24px; }
  .welcome-banner h1 { font-size: 26px; }
  
  .video-grid { grid-template-columns: 1fr; }
}
