:root {
  /* Editor Dark Mode - Refined Palette */
  --bg: #0f0f0f;
  /* YouTube Dark BG */
  --bg-panel: #0f0f0f;
  --bg-input: #121212;
  --text-main: #f1f1f1;
  --text-dim: #aaaaaa;
  --text-muted: #717171;
  --brand: #3ea6ff;
  --accent: #3ea6ff;
  --border: #303030;
  --card-bg: transparent;
  --hover-overlay: rgba(255, 255, 255, 0.1);

  /* Spacing */
  --sidebar-w: 360px;
  /* Wider control room */
  --header-h: 56px;

  /* Component Defaults (Dark Mode / YouTube Default) */
  --bg-sidebar: #0f0f0f;
  --bg-search: #121212;
  --bg-search-btn: #222222;
  --border-search: #303030;

  --bg-chip: rgba(255, 255, 255, 0.1);
  --bg-chip-hover: rgba(255, 255, 255, 0.2);
  --text-chip: #f1f1f1;

  --bg-chip-active: #f1f1f1;
  /* White active chip */
  --text-chip-active: #0f0f0f;
  /* Black text */
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-panel: #ffffff;
  --bg-input: #f2f2f2;
  --text-main: #060606;
  /* Darker black */
  --text-dim: #606060;
  --text-muted: #909090;
  --border: #e5e5e5;
  --card-bg: #ffffff;
  --hover-overlay: rgba(0, 0, 0, 0.05);

  /* Component Specific - YouTube Light Mode */
  --bg-sidebar: #ffffff;
  --bg-search: #ffffff;
  --bg-search-btn: #f0f0f0;
  /* Slightly darker */
  --border-search: #ccc;
  /* Visible border */
  --bg-chip: #f2f2f2;
  --bg-chip-hover: #e5e5e5;
  --text-chip: #0f0f0f;
  --bg-chip-active: #000000;
  --text-chip-active: #ffffff;
}

/* Theme Menu Styles */
.theme-menu {
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.theme-option {
  color: var(--text-main);
  transition: background 0.2s;
}

.theme-option:hover {
  background: var(--hover-overlay);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

/* APP SHELL */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  background: #1e1e1e;
  /* Slightly lighter for validation controls */
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

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

.brand-badge {
  background: var(--brand);
  color: #000;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
}

.brand-text {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.5px;
}

.control-panel {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: calc(100vh - var(--header-h));
}

/* WIDGETS */
.widget-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: 18px;
  padding: 4px;
  gap: 4px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 14px;
  cursor: pointer;
  color: var(--text-dim);
  transition: 0.2s;
}

.tab.active {
  background: #303030;
  color: #fff;
}

input[type="text"],
textarea {
  width: 100%;
  background: #121212;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

input[type="text"]:focus {
  border-color: var(--brand);
}

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #000;
  border: none;
  padding: 12px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  background: #303030;
  color: #717171;
  cursor: not-allowed;
}

/* MAIN STAGE */
.main-stage {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  /* Constrain height for inner scrolling */
}

.main-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid transparent;
  /* seamless */
}

.grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  /* Responsive Grid like YouTube */
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 40px 16px;
  /* Row gap big, Col gap small */
  align-content: start;
}

/* Market Mode Wrapper - Denser "YouTube Homepage" Grid */
/* Market Mode Wrapper - Denser "YouTube Homepage" Grid */
.grid-container.market-mode {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 24px 12px !important;
}

/* Adjust card internals for smaller size */
.grid-container.market-mode .video-card {
  padding: 8px 8px 32px 8px;
  /* Tighter padding */
}

.grid-container.market-mode .card-title {
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 2px;
}

.grid-container.market-mode .card-channel-name,
.grid-container.market-mode .card-stats {
  font-size: 12px;
  line-height: 16px;
}

.grid-container.market-mode .channel-avatar {
  width: 32px;
  height: 32px;
}

/* Market Mode: Move custom card to end */
.grid-container .custom-card {
  order: 9999;
  /* Push to end of grid */
}

/* YOUTUBE CARD REPLICA */
.video-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 0.1s;
  padding: 10px 10px 40px 10px;
  /* Space for absolute button */
  border-radius: 12px;
  position: relative;
  /* Ensure absolute positioning works */
  /* margin-bottom to be handled by grid gap */
}

/* Hover Effect */
.video-card:hover {
  background: var(--hover-overlay);
}

[data-theme="light"] .video-card:hover {
  background: #e5e5e5;
  /* Distinct gray focus */
}

/* Remove weird radius change on hover if it existed */
.video-card:hover .thumb-img {
  opacity: 0.9;
}

/* Thumbnail */
.thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: #202020;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.3s;
}

.video-card:hover .thumb-img {
  /* Slight zoom or brightness? YouTube plays preview. We can't easily. */
  opacity: 0.9;
}

/* Overlay Controls (Our Enhancements) */
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
}

.video-card:hover .thumb-overlay {
  opacity: 1;
}

.chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: auto;
}

.ts-chip {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-weight: 500;
}

.ts-chip:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #000;
}

.upload-btn-mini {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.upload-btn-mini:hover {
  background: #fff;
  color: #000;
}


/* Meta Data Structure */
.card-details {
  display: flex;
  gap: 12px;
  padding-right: 24px;
  /* Space for the 3-dot menu */
  position: relative;
}

.channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #333;
  /* Placeholder color */
  flex-shrink: 0;
}

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  /* Text truncation fix */
}

/* Typography matching YouTube */
.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  outline: none;
  border: 1px dotted transparent;
}

.card-title:focus {
  border-color: var(--brand);
  background: var(--bg-input);
}

.card-channel-name,
.card-stats {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 18px;
}

.card-channel-name:hover {
  color: var(--text-main);
}

.card-channel-name {
  border: 1px dotted transparent;
  outline: none;
}

.card-channel-name:focus {
  border-color: var(--brand);
  background: var(--bg-input);
}

/* Actions (Regen/Delete) - Styled as "Menu" or Footer */
.card-actions-row {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  opacity: 1;
  justify-content: flex-end;
  z-index: 10;
}

/* 
.video-card:hover .card-actions-row {
  opacity: 1;
} 
*/

.action-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
}

.action-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.action-check input {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}



/* Custom Card Styles */
.custom-upload-area {
  width: 100%;
  height: 100%;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-dim);
  transition: 0.2s;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.custom-upload-area:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(255, 255, 255, 0.05);
}

.editable-text {
  border: 1px solid transparent;
  padding: 2px;
  border-radius: 4px;
  transition: 0.2s;
  min-height: 1.5em;
  /* clickable area */
}

.editable-text:hover {
  border-color: var(--border);
}

.editable-text:focus {
  border-color: var(--brand);
  background: var(--bg-input);
  outline: none;
}

/* UTIL */
.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 18px;
  cursor: pointer;
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #303030;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--brand);
}

input:checked+.slider:before {
  transform: translateX(14px);
}

/* PROGRESS OVERLAY RESTORATION */
#progressOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  /* Darker backdrop */
  z-index: 999;
  display: none;
  place-items: center;
  justify-content: center;
}

#progressOverlay>div {
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  /* Slightly sharper than 12px */
  width: 480px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#progressOverlay h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

#progressOverlay h3::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

#barContainer {
  height: 4px;
  background: #222;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

#modalBar {
  height: 100%;
  background: var(--brand);
  width: 0%;
  transition: width 0.2s linear;
  box-shadow: 0 0 10px var(--brand);
}

#modalStatus {
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
}

#modalLog {
  display: block !important;
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 10px;
  height: 150px;
  overflow-y: auto;
  font-family: "Consolas", monospace;
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

#modalLog div {
  margin-bottom: 2px;
  border-bottom: 1px solid #151515;
  padding-bottom: 2px;
}

#modalLog div strong {
  color: #aaa;
}

/* HISTORY PANEL IMPROVEMENTS (ChatGPT Style) */
#hList {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hitem {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hitem:hover {
  background: #202123;
  /* Subtle dark interaction */
}

.hitem-title {
  color: #ececf1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.hitem-date {
  color: #8e8ea0;
  font-size: 12px;
}

/* Scrollbar refinement for history */
#hList::-webkit-scrollbar {
  width: 8px;
}

#hList::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

#hList::-webkit-scrollbar-track {
  background: transparent;
}

/* SIDEBAR REFINEMENT (Reference "Juail Food") */

/* Update Sidebar Background to be Darker */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

/* Sidebar Header */
.sidebar-header {
  background: transparent;
  border-bottom: 1px solid transparent;
  /* Cleaner look */
}

/* Tab Bar (Video Source) */
.tabs {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 3px;
  border: 1px solid var(--border);
}

.tab {
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  padding: 8px 12px;
}

.tab.active {
  background: #2a2a2a;
  /* Keep dark for contrast in dark mode, maybe var later */
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Inputs */
input[type="text"],
textarea,
.file-input-dummy {
  /* If we used a custom file input wrapper */
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  /* Nicer rounded corners */
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.2s ease;
}

/* Ensure text is visible in light theme */
[data-theme="light"] input[type="text"],
[data-theme="light"] textarea {
  color: #060606;
  /* Dark text for light background */
}

input[type="text"]:focus,
textarea:focus {
  background: var(--bg-input);
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(62, 166, 255, 0.1);
}

/* Widget Layouts */
.widget {
  background: transparent;
  border: none;
  margin-bottom: 24px;
  padding: 0 4px;
}

.widget-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: capitalize;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* File Input Override Styling */
input[type="file"] {
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-muted);
  width: 100%;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

input[type="file"]:hover {
  border-color: #666;
  background: #202020;
  color: #eee;
}

input[type="file"]::file-selector-button {
  background: #333;
  border: none;
  color: #eee;
  padding: 6px 12px;
  margin-right: 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
  background: #444;
}

/* Primary Button (Generate) */
.btn-primary {
  background: linear-gradient(135deg, #3ea6ff, #3083cc);
  /* Subtle gradient */
  border-radius: 12px;
  font-weight: 600;
  text-transform: none;
  /* Keep natural case */
  box-shadow: 0 4px 12px rgba(62, 166, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(62, 166, 255, 0.3);
  transform: translateY(-1px);
}

/* Toggles */
.switch {
  width: 36px;
  height: 20px;
}

.active+.slider {
  background-color: var(--brand);
}

.slider.round:before {
  width: 16px;
  height: 16px;
  bottom: 2px;
  left: 2px;
}

/* Context Text inputs spacing */
#titleHint,
#angleHint {
  margin-top: 6px;
}

/* Placeholder color */
::placeholder {
  color: #444;
  font-weight: 500;
}

/* Mini Upload Button on Card (Transparent, no border) */
.upload-btn-mini {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  margin-left: 6px;
  line-height: 1;
  opacity: 0.8;
  transition: transform 0.2s, opacity 0.2s;
  /* Ensure no default button border/shadow details */
  box-shadow: none !important;
  outline: none !important;
}

.upload-btn-mini:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* History Panel Layout Adjustment */
body.history-open .main-stage {
  margin-right: 320px;
  /* Push content to avoid overlap */
  transition: margin-right 0.3s ease;
}

/* Ensure smooth transition in reverse */
.main-stage {
  transition: margin-right 0.3s ease;
}

/* Thumbnail Loading Overlay */

/* --- NEW HISTORY VIEW (Watch History Style) --- */
.history-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 10%;
  /* Center channel style */
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.history-page-header {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

.history-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

.history-card {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  cursor: pointer;

  /* For hover detection */
}

.history-thumb {
  width: 260px;
  aspect-ratio: 16/9;
  background: #202020;
  border-radius: 8px;
  /* Slightly tighter than main cards */
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.history-thumb img,
.history-video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding-top: 4px;
  /* Align with top of video */
}

.history-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
  /* Max 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-channel {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.history-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  /* Visible by default */
  align-self: flex-start;
  transition: background 0.2s;
  margin-left: auto;
  /* Push to right if flex container */
}

/* .history-card:hover .history-menu-btn { opacity: 1; } - Already visible */

.history-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Red line at bottom of thumb (Watch progress simulation) */
.history-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-input);
  /* Grey bar */
}

.history-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: 90%;
  /* Fake progress */
  background: #f00;
  /* YouTube Red */
}

.thumb-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  /* Match card radius */
}

.thumb-loader::after {
  content: "";
  width: 32px;
  height: 32px;
  border: 4px solid var(--brand);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* LOGIN SCREEN */
.login-screen {
  position: fixed;
  inset: 0;
  background: #050510;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 10000;
  display: grid;
  place-items: center;
  font-family: 'Inter', sans-serif;
}

/* Vignette */
.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 20%, #050510 90%);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 380px;
  padding: 40px;
  background: rgba(15, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 10001;
}

.login-logo {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: #a855f7;
  /* Purple accent */
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
}

.login-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 32px;
  line-height: 1.5;
}

.google-btn {
  width: 100%;
  height: 44px;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.google-btn:hover {
  background: #f8f8f8;
}

.google-btn:active {
  transform: scale(0.98);
}

.login-footer {
  margin-top: 24px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

/* ==========================================
   USER PROFILE MENU
   ========================================== */
.user-menu-container {
  position: relative;
}

.user-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: transform 0.2s;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.user-menu-btn:hover {
  transform: scale(1.05);
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: white;
  font-size: 16px;
  text-transform: uppercase;
  background-color: var(--brand);
  /* Default fallback */
}

/* Dropdown Container */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 12px;
  width: 260px;
  background: #1e1e2d;
  /* Slightly lighter than main bg */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 2000;
  overflow: hidden;
  animation: slideDown 0.15s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown Header */
.dropdown-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.dropdown-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

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

.dropdown-name {
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  margin-bottom: 4px;
}

.dropdown-email {
  font-size: 13px;
  color: var(--text-dim);
}

/* Dropdown Items */
.dropdown-item {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}