/* ==========================================================================
   Drameeo Cinema — Main Stylesheet
   Color Palette:
   Background: #090B18
   Sidebar:    #151526
   Cards:      #1B1B30
   Accent:     #A970FF
   Secondary:  #50B9F5
   Main Text:  #F6F4FF
   Muted Text: #A6A4B8
   ========================================================================== */

:root {
  --bg-main: #090B18;
  --bg-sidebar: #151526;
  --bg-card: #1B1B30;
  --bg-card-hover: #22223D;
  --bg-input: #121224;
  --bg-glass: rgba(21, 21, 38, 0.75);
  
  --accent-purple: #A970FF;
  --accent-purple-glow: rgba(169, 112, 255, 0.35);
  --accent-purple-dim: rgba(169, 112, 255, 0.15);
  --secondary-blue: #50B9F5;
  --secondary-blue-glow: rgba(80, 185, 245, 0.35);
  
  --text-main: #F6F4FF;
  --text-muted: #A6A4B8;
  --text-dim: #6C6A80;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(169, 112, 255, 0.5);
  
  --sidebar-width: 250px;
  --topbar-height: 68px;
  
  /* Standard Spacing Scale (8-point grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  /* Standard Interaction Colors */
  --color-favourite: #F04462;
  --color-favourite-glow: rgba(240, 68, 98, 0.4);
  --color-favourite-bg: rgba(240, 68, 98, 0.18);
  --color-favourite-border: rgba(240, 68, 98, 0.45);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  60% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

.heart-pulse {
  animation: heartPulse 0.36s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #252542;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* Application Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - 32px);
  position: fixed;
  top: 16px;
  left: 16px;
  background-color: var(--bg-sidebar);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform var(--transition-smooth);
}

.sidebar-header {
  padding: 24px 22px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-purple), var(--secondary-blue));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px var(--accent-purple-glow);
  overflow: hidden;
}

.logo-badge svg {
  width: 22px;
  height: 22px;
  fill: #FFFFFF;
}

.logo-badge img,
.logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

.logo-img-auth {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #FFFFFF 30%, var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}

.sidebar-section {
  margin-bottom: 22px;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  font-weight: 700;
  padding: 6px 12px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #FFFFFF;
  background: linear-gradient(90deg, rgba(169, 112, 255, 0.22) 0%, rgba(169, 112, 255, 0.05) 100%);
  border-left: 3px solid var(--accent-purple);
  box-shadow: 0 4px 16px rgba(169, 112, 255, 0.12);
}

.nav-item.active svg {
  color: var(--accent-purple);
  filter: drop-shadow(0 0 8px var(--accent-purple-glow));
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.nav-item:hover svg {
  transform: scale(1.1);
}

.nav-badge {
  margin-left: auto;
  background-color: var(--accent-purple-dim);
  color: var(--accent-purple);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15, 15, 28, 0.5);
}

.user-quick-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-info-text {
  flex: 1;
  min-width: 0;
}

.user-display-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: capitalize;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-wrapper {
  flex: 1 1 0%;
  min-width: 0;
  width: calc(100% - (var(--sidebar-width) + 32px));
  max-width: calc(100% - (var(--sidebar-width) + 32px));
  margin-left: calc(var(--sidebar-width) + 32px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 60px;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Top Navigation Bar */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 0 20px;
  position: sticky;
  top: 0;
  background: rgba(9, 11, 24, 0.88);
  backdrop-filter: blur(18px);
  z-index: 90;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  max-width: 600px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
}

/* Global Search Input with Glow */
.search-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-input {
  width: 100%;
  height: 44px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 40px 0 42px;
  color: var(--text-main);
  font-size: 14px;
  transition: all var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  background-color: var(--bg-card-hover);
  box-shadow: 0 0 20px rgba(169, 112, 255, 0.2);
}

.search-input:focus ~ .search-icon {
  color: var(--accent-purple);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: none;
}

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

/* Server Status Pill */
.server-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: #10B981;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.icon-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.badge-counter {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-purple);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-purple);
}

/* User Profile Menu Dropdown */
.profile-menu-container {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  backdrop-filter: blur(20px);
}

.dropdown-panel.show {
  display: flex;
  animation: dropdown-fade var(--transition-fast);
}

@keyframes dropdown-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.dropdown-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 6px 0;
}

/* Content Container */
.content-body {
  padding: var(--space-5) var(--space-6);
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  margin-top: var(--space-6);
}

.section-header:first-child {
  margin-top: 0;
}

.section-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title-accent {
  width: 4px;
  height: 18px;
  background: linear-gradient(to bottom, var(--accent-purple), var(--secondary-blue));
  border-radius: 2px;
}

.view-all-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition-fast);
}

.view-all-link:hover {
  color: #C095FF;
  gap: 9px;
}

