@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Studio Brand Colors (Extracted from RenderPhoenix brand system) */
  --brand-purple: #5A4077;
  --brand-purple-light: #7C3AED;
  --brand-purple-dark: #45305C;
  --brand-purple-tint: rgba(90, 64, 119, 0.12);
  --brand-purple-border: rgba(90, 64, 119, 0.28);

  --brand-pink: #FF79AC;
  --brand-pink-dark: #E65C92;
  --brand-pink-tint: rgba(255, 121, 172, 0.12);
  --brand-pink-glow: rgba(255, 121, 172, 0.25);
  --brand-pink-border: rgba(255, 121, 172, 0.35);

  /* Deep Studio Dark Glass Surface */
  --bg-app: #0D0B14;
  --bg-sidebar: rgba(19, 16, 29, 0.82);
  --bg-surface: rgba(24, 20, 36, 0.70);
  --bg-surface-elevated: rgba(32, 27, 48, 0.85);
  --bg-surface-hover: rgba(42, 35, 62, 0.75);
  --bg-input: rgba(16, 13, 24, 0.85);
  --bg-code: #0A0810;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(90, 64, 119, 0.50);
  --border-focus: #7C3AED;

  --text-main: #F4F1FA;
  --text-muted: #9E97B2;
  --text-dim: #6B647E;
  --text-inverse: #1E1B29;

  --status-published-bg: rgba(16, 185, 129, 0.12);
  --status-published-text: #10B981;
  --status-draft-bg: rgba(245, 158, 11, 0.12);
  --status-draft-text: #F59E0B;
  --status-modified-bg: rgba(124, 58, 237, 0.14);
  --status-modified-text: #A78BFA;
  --status-danger-bg: rgba(239, 68, 68, 0.12);
  --status-danger-text: #EF4444;

  /* True Glassmorphism & Subtle Box Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.60);
  --shadow-glass: inset 0 1px 1px 0 rgba(255, 255, 255, 0.08), 0 12px 32px rgba(0, 0, 0, 0.45);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --header-height: 64px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-pink);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #FFFFFF;
}

/* Layout App Shell */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-smooth), width var(--transition-smooth);
  z-index: 100;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.sidebar-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-pink-tint);
  color: var(--brand-pink);
  border: 1px solid var(--brand-pink-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-color);
}

.nav-item.active {
  background-color: var(--brand-purple);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(90, 64, 119, 0.35);
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.15);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--brand-purple);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.logout-btn {
  color: var(--text-dim);
  padding: 6px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  background-color: rgba(239, 68, 68, 0.14);
  color: #EF4444 !important;
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-app);
}

/* Top Header Bar */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  z-index: 50;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-surface-hover);
}

.header-page-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

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

/* Viewport Scrollable Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* Views Pill Component */
.views-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 121, 172, 0.10);
  color: #FF79AC;
  border: 1px solid rgba(255, 121, 172, 0.22);
  white-space: nowrap;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .sidebar-toggle-btn {
    display: flex;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 90;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .app-content {
    padding: 16px;
  }

  .app-header {
    padding: 0 16px;
  }
}
