/* ========================================
   REDDIT VAULT — Reddit-Style Dark Theme
======================================== */

/* ===== Variables ===== */
:root {
  --bg-canvas: #030303;
  --bg-body: #1a1a1b;
  --bg-hover: #252526;
  --bg-nav: #1a1a1b;
  --bg-widget: #1a1a1b;
  --bg-input: #272729;
  --border: #343536;
  --border-hover: #4a4a4c;
  --text-1: #d7dadc;
  --text-2: #818384;
  --text-3: #6a6a6b;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-dim: rgba(139, 92, 246, 0.15);
  --accent-glow: rgba(139, 92, 246, 0.25);
  --reddit-orange: #ff4500;
  --green: #46d160;
  --red: #ff585b;
  --orange: #fbbf24;
  --blue: #4fbcff;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 100px;
  --radius-full: 9999px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: .15s ease;
  --navbar-height: 48px;
  --left-sidebar-width: 270px;
  --right-sidebar-width: 0px;
}

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

.hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-canvas);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #3a3a3c;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a4a4c;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: var(--font);
}

input,
textarea,
select {
  font-family: var(--font);
}

/* ========================================
   NAVBAR — Reddit-style top bar
======================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: var(--navbar-height);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
}

.browse-only.hidden,
.vault-only.hidden {
  display: none !important;
}

.nav-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.nav-browse-btn,
.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.nav-browse-btn svg,
.nav-tab-btn svg {
  width: 20px;
  height: 20px;
}

.nav-browse-btn:hover,
.nav-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.nav-browse-btn.active,
.nav-tab-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-1);
  cursor: pointer;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--reddit-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: white;
}

/* Center Search */
.nav-center {
  flex: 1;
  max-width: 800px;
  margin: 0 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-block {
  position: relative;
  flex: 1;
  min-width: 0;
}

.navbar-search {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 16px;
  height: 40px;
  gap: 8px;
  transition: border-color var(--transition), background var(--transition);
}

.navbar-search:hover {
  border-color: var(--text-1);
}

/* Vault Tabs in Navbar */
.nav-vault-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius);
  /* background: rgba(255, 255, 255, 0.03); removed to match blue box background style if any */
}

.nav-vault-tabs .vault-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.nav-vault-tabs .vault-tab:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.nav-vault-tabs .vault-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.followed-btn-style {
  background: var(--accent) !important;
  color: white !important;
  border-radius: var(--radius) !important;
  font-weight: 900 !important;
  padding: 0 16px !important;
  height: 32px !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  border: none !important;
  box-shadow: 0 4px 12px var(--accent-glow) !important;
}

.followed-btn-style:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

.nav-vault-tabs .vault-tab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.navbar-search:focus-within {
  border-color: var(--text-1);
  background: var(--bg-canvas);
}

.navbar-search .search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-2);
  flex-shrink: 0;
}

.navbar-search .search-prefix {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  font-family: 'Noto Sans Mono', monospace;
  flex-shrink: 0;
}

.navbar-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-1);
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.navbar-search input::placeholder {
  color: var(--text-3);
}

.nav-follow-btn {
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  margin-right: 4px;
}

.nav-follow-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

.nav-follow-btn.following {
  color: var(--accent);
}

.nav-follow-btn.following svg {
  fill: var(--accent);
}

.nav-follow-btn svg {
  width: 18px;
  height: 18px;
}

/* Mode Toggle in Search */
.navbar-search .search-mode-toggle {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  padding: 2px;
}

.navbar-search .mode-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-2);
  transition: all var(--transition);
}

.navbar-search .mode-btn:hover {
  color: var(--text-1);
}

.navbar-search .mode-btn.active {
  background: var(--accent);
  color: white;
}

.search-mode-toggle {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
    border-radius: var(--radius-full);
}

.search-mode-toggle .mode-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-2);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.search-mode-toggle .mode-btn.active {
    background: var(--accent);
    color: white;
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.search-suggestions .suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-1);
  transition: background var(--transition);
}

.search-suggestions .suggestion-item:hover {
  background: var(--bg-hover);
}

/* Right Nav Buttons */
.cloud-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  transition: all var(--transition);
  border: 1px solid var(--border);
  margin-right: 4px;
}

.cloud-status-indicator .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  transition: all var(--transition);
}

.cloud-status-indicator.connected {
  color: var(--text-1);
  border-color: var(--accent);
}

.cloud-status-indicator.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.cloud-status-indicator.error {
  color: var(--red);
  border-color: var(--red);
}

.cloud-status-indicator.error .status-dot {
  background: var(--red);
}

.cloud-status-indicator.initializing .status-dot {
  background: #f1c40f;
  box-shadow: 0 0 8px #f1c40f;
  animation: cloud-pulse 1.5s infinite;
}

@keyframes cloud-pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.nav-btn.active {
  color: var(--text-1);
}

#btn-lock:hover {
  background: rgba(234, 67, 53, 0.1);
  color: #ea4335;
}

/* Navbar Vault Button (Combined with Browse above) */
#nav-vault {
  /* Legacy styles removed, inheriting from .nav-tab-btn */
}

/* Navbar Density Pills */
.nav-density-group {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

.density-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
  transition: all var(--transition);
}

.density-btn:hover {
  color: var(--text-1);
}

.density-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ========================================
   THREE-COLUMN LAYOUT
======================================== */
.reddit-layout {
  display: flex;
  padding: 20px 32px;
  min-height: calc(100vh - var(--navbar-height));
  justify-content: flex-start;
}

/* ===== LEFT SIDEBAR ===== */
.left-sidebar {
  width: var(--left-sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--navbar-height) + 20px);
  height: calc(100vh - var(--navbar-height) - 40px);
  overflow-y: auto;
  scrollbar-width: none;
}

.left-sidebar.hidden {
  display: none;
}

.left-sidebar::-webkit-scrollbar {
  display: none;
}

.left-sidebar .sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

/* Sidebar Action Buttons */
.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition);
}

.sidebar-action-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-2);
}

.sidebar-action-btn:hover {
  background: var(--bg-hover);
}

.sidebar-action-btn.follow-btn.following {
  color: var(--accent);
}

.sidebar-action-btn.follow-btn.following svg {
  color: var(--accent);
  fill: var(--accent);
}

/* Sidebar Sub Title */
.sidebar-sub-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  padding: 8px 16px;
  word-break: break-all;
}

/* Sidebar Filter Labels */
.sidebar-filter-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  padding: 8px 16px 4px;
}

/* Sidebar Sections */
.left-sidebar .sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Pill Groups in Sidebar */
.left-sidebar .pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 16px;
}

.pill {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.pill:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ===== CENTER FEED ===== */
.feed-container {
  flex: 1;
  min-width: 0;
  /* margin: 0 auto removed to allow filling space between sidebars */
}

/* Feed Sort Bar (Retired - elements moved to navbar) */
.feed-sort-bar {
  display: none;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sort-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.sort-divider.hidden {
  display: none !important;
}

.sort-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.sort-tab svg {
  width: 20px;
  height: 20px;
}

.sort-tab:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.sort-tab.active,
.dropdown-item.active {
  background: var(--accent);
  color: white;
}

/* Custom Dropdown */
.custom-dropdown {
  position: relative;
  min-width: 100px;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--text-1);
  transition: all var(--transition);
}

.dropdown-trigger:hover {
  background: var(--bg-nav);
  border-color: var(--border-hover);
}

.trigger-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trigger-display svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.dropdown-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  min-width: 100%;
}

.dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: color 0.2s;
}

.dropdown-item:hover svg {
  color: var(--text-1);
}

.dropdown-item.active svg {
  color: #fff;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

#density-pills .sort-tab.active {
  background: var(--accent) !important;
  color: white !important;
}

/* Dropdown Menu - Selection indicator fix */
.dropdown-item.active {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
}

/* ===== POST CARDS (Reddit-style grid/list) ===== */
.posts-feed {
  display: grid;
  gap: 16px;
  width: 100%;
}

.post-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
  animation: fadeInPost 0.3s ease forwards;
  opacity: 0;
}

@keyframes fadeInPost {
  to {
    opacity: 1;
  }
}

.post-card:hover {
  border-color: var(--border-hover);
}

/* Post Header */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 0;
  font-size: 12px;
  flex-wrap: wrap;
}

.post-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}





.post-sub {
  font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
}

.post-sub:hover {
  text-decoration: underline;
}

.post-author {
  color: var(--text-2);
}

.post-time {
  color: var(--text-3);
  margin-left: auto;
}

.post-flair {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.post-nsfw {
  background: rgba(255, 88, 91, 0.15);
  color: var(--red);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

/* Post Title */
.post-title {
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.post-title a {
  color: var(--text-1);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--accent);
}

/* Post Body (selftext) */
.post-body {
  padding: 0 12px 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  max-height: 200px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}

/* Post Media */
.post-media {
  margin: 4px 0;
  overflow: hidden;
  background: #000;
}

.post-media img {
  width: 100%;
  max-height: 700px;
  object-fit: contain;
  display: block;
}

.post-media video {
  width: 100%;
  max-height: 700px;
  display: block;
}

.post-media audio {
  width: 100%;
  padding: 12px;
}

/* Gallery */
.post-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0;
}

.post-gallery img {
  min-width: 100%;
  scroll-snap-align: center;
  flex-shrink: 0;
}

/* Embeds */
.embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Video Thumbnail */
a.post-media.video-thumb {
  display: block;
  position: relative;
}

a.post-media.video-thumb img {
  width: 100%;
  display: block;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn svg {
  width: 24px;
  height: 24px;
  color: white;
}

/* Post Footer */
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 4px 12px;
}

.post-stats {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  border-radius: var(--radius-full);
  transition: background var(--transition);
  cursor: pointer;
}

.post-stat:hover {
  background: var(--bg-hover);
}

.post-stat svg {
  width: 18px;
  height: 18px;
}

.post-stat.up svg {
  color: var(--reddit-orange);
}

.post-actions {
  display: flex;
  gap: 4px;
}

/* ===== RIGHT SIDEBAR ===== */
.right-sidebar {
  width: var(--right-sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--navbar-height) + 20px);
  height: calc(100vh - var(--navbar-height) - 40px);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.right-sidebar::-webkit-scrollbar {
  display: none;
}

.widget-card {
  background: var(--bg-widget);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}
#widget-followed-list {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 4px 12px;
}

#nav-followed-dropdown {
  min-width: 140px;
}

#nav-followed-dropdown .dropdown-trigger {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  height: 36px;
  border-radius: var(--radius);
  transition: background var(--transition), transform 0.1s;
}

#nav-followed-dropdown .dropdown-trigger:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

#nav-followed-dropdown .dropdown-trigger:active {
  transform: translateY(0);
}

#nav-followed-dropdown .dropdown-menu {
  right: 0;
  left: auto;
  width: 300px;
  background: rgba(26, 26, 27, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  margin-top: 8px;
  border-radius: var(--radius);
}

.widget-fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition);
}

.widget-fav-item:last-child {
  border-bottom: none;
}

.widget-fav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.widget-fav-link {
  transition: color var(--transition);
}

.widget-fav-link:hover {
  color: var(--accent) !important;
  text-decoration: none !important;
}

.btn-unfollow {
  opacity: 0.5;
  transition: opacity var(--transition), color var(--transition);
}

.btn-unfollow:hover {
  opacity: 1;
  color: var(--red) !important;
}

.widget-footer-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  padding: 12px 16px;
}

.widget-links {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* ========================================
   BUTTONS
======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

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

.btn-secondary {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-1);
  width: 100%;
}

.btn-secondary:hover {
  border-color: var(--text-2);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-1);
}

.btn-outline:hover {
  border-color: var(--text-1);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--text-2);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-save {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.btn-save:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-save.saved {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-remove {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ========================================
   LOADING & ERROR
======================================== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-3);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-msg {
  text-align: center;
  padding: 24px;
  color: var(--red);
  font-size: 14px;
  background: rgba(255, 88, 91, 0.06);
  border: 1px solid rgba(255, 88, 91, 0.12);
  border-radius: var(--radius);
  margin: 16px 0;
}

/* ========================================
   VAULT
======================================== */
.vault-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 40px;
}

.lock-card {
  text-align: center;
  max-width: 380px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
}

.lock-icon-wrap {
  margin-bottom: 20px;
}

.lock-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
}

.lock-card h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.lock-card p {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 20px;
}

.passcode-row {
  display: flex;
  gap: 8px;
}

.passcode-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 16px;
  outline: none;
}

.passcode-input:focus {
  border-color: var(--accent);
}

.passcode-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
}

/* Vault Content */
.vault-content {
  padding: 0;
}

.vault-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
}

.vault-title {
  font-size: 20px;
  font-weight: 700;
}

.vault-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.vault-tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.vault-tab:hover {
  color: var(--text-1);
}

.vault-tab.active {
  color: var(--text-1);
  border-bottom-color: var(--accent);
}

.vault-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.vault-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-1);
  font-size: 14px;
  outline: none;
}

.vault-search:focus {
  border-color: var(--text-2);
}

.vault-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.vault-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.vault-empty p {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.vault-empty span {
  font-size: 13px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-info {
  color: var(--text-2);
  font-size: 14px;
  padding: 8px 0 16px;
}

/* Subreddit Groups / Folders */
.groups-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 24px;
  margin-top: 32px;
  justify-content: start;
}

.subreddit-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.subreddit-row:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.subreddit-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.subreddit-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  word-break: break-all;
}

.subreddit-count {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}

.subreddit-dividers {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}

.subreddit-divider {
  width: 2px;
  height: 12px;
  background: var(--border);
  opacity: 0.5;
}

.chevron-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-3);
  opacity: 0.4;
}

/* Folder Detail View */
.folder-detail-view {
  margin-top: 16px;
}

.folder-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-1);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-back:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.btn-back svg {
  width: 16px;
  height: 16px;
}

.posts-feed.single-column {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.posts-feed.single-column > .post-card {
  width: 100% !important;
}

.subreddit-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition);
}

.group-header:hover {
  background: var(--bg-hover);
}

.group-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--text-1);
}

.group-header::after {
  content: "";
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23818384' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 0.3s ease;
}

.subreddit-group.collapsed .group-header::after {
  transform: rotate(-90deg);
}

.subreddit-group.collapsed .posts-feed {
  display: none;
}

.subreddit-group .posts-feed {
  border-top: 1px solid var(--border);
  padding: 8px;
}




.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ========================================
   GOOGLE DISGUISE
======================================== */
.google-disguise {
  position: fixed;
  inset: 0;
  background: #202124;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.google-disguise.hidden {
  display: none;
}

.google-center {
  text-align: center;
}

.google-logo {
  font-family: 'Product Sans', Arial, sans-serif;
  font-size: 92px;
  margin-bottom: 30px;
  user-select: none;
}

.google-search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  height: 46px;
  background: #303134;
  border: 1px solid #5f6368;
  border-radius: 24px;
  padding: 0 14px;
  transition: background-color 200ms;
}

.google-search-bar:hover,
.google-search-bar:focus-within {
  background: #303134;
  border-color: rgba(223, 225, 229, 0);
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.google-search-bar svg {
  width: 20px;
  height: 20px;
  fill: #9aa0a6;
  margin-right: 12px;
}

.google-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e8eaed;
  font-size: 16px;
  height: 100%;
  outline: none;
}

.google-mic svg {
  width: 24px;
  height: 24px;
  margin-left: 12px;
  cursor: pointer;
  margin-right: 0;
}

.google-buttons {
  margin-top: 30px;
  display: flex;
  gap: 12px;
}

.google-buttons button {
  background: #303134;
  border: 1px solid #303134;
  border-radius: 4px;
  color: #e8eaed;
  font-family: arial, sans-serif;
  font-size: 14px;
  padding: 0 16px;
  line-height: 27px;
  height: 36px;
  min-width: 54px;
  cursor: pointer;
}

.google-buttons button:hover {
  border: 1px solid #5f6368;
}

/* ========================================
   BOTTOM CONTROLS
======================================== */
.bottom-controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.nav-volume.compact {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(26, 26, 27, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  opacity: 0.4;
  transition: all var(--transition);
}

.nav-volume.compact:hover {
  opacity: 1;
  border-color: var(--accent);
}

.nav-volume.compact svg {
  width: 12px;
  height: 12px;
  color: var(--text-2);
}

#global-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#global-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.compact-btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(26, 26, 27, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
  opacity: 0.4;
  transition: all var(--transition);
}

.compact-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.compact-btn svg {
  width: 12px;
  height: 12px;
}

/* ========================================
   DENSITY VARIANTS (Grid System)
======================================== */

/* XS: 4 Columns, Text + Media balanced */
body.density-xs .feed-container {
  max-width: 100%;
}

body.density-xs .posts-feed {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

body.density-xs .post-card .post-body {
  display: none;
}

body.density-xs .post-card .post-media img,
body.density-xs .post-card .post-media video,
body.density-xs .post-card .post-media .embed-wrap {
  max-height: 140px;
}

body.density-xs .post-card .post-title {
  font-size: 11px;
  padding: 3px 10px;
}

body.density-xs .post-card .post-header {
  padding: 4px 10px 0;
  font-size: 10px;
}

body.density-xs .post-card .post-footer {
  padding: 2px 6px;
  font-size: 9px;
}

/* Small: 3 Columns, Compact thumbnails */
body.density-small .feed-container {
  max-width: 100%;
}

body.density-small .posts-feed {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

body.density-small .post-card .post-media img,
body.density-small .post-card .post-media video,
body.density-small .post-card .post-media .embed-wrap {
  max-height: 200px;
}

body.density-small .post-card .post-title {
  font-size: 12.5px;
}

body.density-small .post-card .post-header {
  font-size: 11px;
}

body.density-small .post-card .post-body {
  font-size: 11px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Medium: 2 Columns (Default balanced) */
body.density-medium .feed-container {
  max-width: 100%;
}

body.density-medium .posts-feed {
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

body.density-medium .post-card .post-media img,
body.density-medium .post-card .post-media video,
body.density-medium .post-card .post-media .embed-wrap {
  max-height: 380px;
}

body.density-medium .post-card .post-title {
  font-size: 14.5px;
}

body.density-medium .post-card .post-header {
  font-size: 12px;
}

/* Large: 1 Column (Centered & Balanced) */
body.density-large .feed-container {
  max-width: 800px;
  margin: 0 auto;
}

body.density-large .posts-feed {
  grid-template-columns: 1fr;
  padding: 0 16px;
}

body.density-large .post-card .post-media img,
body.density-large .post-card .post-media video,
body.density-large .post-card .post-media .embed-wrap {
  max-height: 650px;
}

body.density-large .post-card .post-title {
  font-size: 18px;
}

/* XL: 1 Column (Ultimate detail, full width) */
body.density-xl .feed-container {
  max-width: 100%;
}

body.density-xl .posts-feed {
  grid-template-columns: 1fr;
}

body.density-xl .post-card .post-media img,
body.density-xl .post-card .post-media video,
body.density-xl .post-card .post-media .embed-wrap {
  max-height: 1000px;
}

body.density-xl .post-card .post-title {
  font-size: 20px;
}

/* ========================================
   TOAST
======================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

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

/* Embed Loading Skeleton */
.embed-wrap {
  position: relative;
  background: var(--bg-hover);
  overflow: hidden;
}

.embed-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  to {
    left: 150%;
  }
}

#view-vault.edit-mode-active .btn-remove {
  display: flex !important;
}

#view-vault:not(.edit-mode-active) .btn-remove {
  display: none !important;
}

#view-vault.edit-mode-active .post-card {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ========================================
   PIN LOCK SCREEN
======================================== */
.pin-lock {
  position: fixed;
  inset: 0;
  background: #08080a;
  /* Slightly darker */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.pin-card {
  text-align: center;
  width: 300px;
}

.pin-icon svg {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 16px;
}

.pin-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-1);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s ease;
}

.pin-dots span.filled {
  background: var(--accent);
  border-color: var(--accent);
}

.pin-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pin-error {
  color: var(--red);
  font-size: 13px;
  margin-bottom: 16px;
  animation: shake 0.4s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto;
}

.pin-key {
  width: 72px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-1);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.pin-key:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.pin-key:active {
  transform: scale(0.95);
}

.pin-key-empty {
  border: none;
  background: transparent;
  cursor: default;
}

.pin-key-empty:hover {
  background: transparent;
  border: none;
}

.pin-key-del svg {
  width: 22px;
  height: 22px;
}

/* ========================================
   SIDEBAR NAV TABS (Browse / Vault)
======================================== */
.sidebar-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-nav-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.sidebar-nav-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-nav-btn.active svg {
  color: var(--accent);
}

/* Vault Tabs in Sidebar */
.vault-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.vault-tab:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}

.vault-tab.active {
  background: var(--bg-hover);
  color: var(--text-1);
  font-weight: 700;
  border-left: 3px solid var(--accent);
}

/* ========================================
   UTILITY
======================================== */
.hidden {
  display: none !important;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1100px) {
  .right-sidebar {
    display: none;
  }

  .reddit-layout {
    max-width: 740px;
  }
}

@media (max-width: 768px) {
  .left-sidebar {
    display: none;
  }

  .reddit-layout {
    padding: 8px;
  }

  .feed-container {
    max-width: 100%;
  }

  .navbar {
    padding: 0 12px;
    gap: 8px;
  }

  .nav-btn span {
    display: none;
  }

  .nav-density-group {
    display: none;
  }

  .navbar-search .search-mode-toggle {
    display: none;
  }
}

/* ========================================
   CUSTOM CONTENT VAULT STYLES
======================================== */
.custom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.custom-item-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.custom-item-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-item-preview {
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.custom-item-preview>* {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.custom-item-preview img {
  object-fit: cover;
}

.custom-link-preview {
  font-size: 32px;
  color: var(--text-2);
}

.custom-note-preview {
  padding: 12px;
  font-size: 13px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.custom-item-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-item-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-item-type {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

.custom-input-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

.custom-input-group input {
  flex: 1;
}

/* Custom Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-card.custom-modal-card {
  width: 100%;
  max-width: 900px;
  height: auto;
  max-height: 90vh;
  background: var(--bg-nav);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  flex: 1;
  overflow: auto;
  background: #000;
}

.modal-body iframe,
.modal-body .reddit-card {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

.custom-modal-note {
  padding: 30px;
  color: var(--text-1);
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--bg-body);
}

/* Edit Mode for Custom Items */
.custom-item-card.edit-mode {
  border-color: var(--red);
  cursor: default;
}

.btn-remove-custom {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 5;
  cursor: pointer;
}
/* ========================================
   GOOGLE DISGUISE - CALCULATOR
======================================== */
#pin-lock {
    background: #202124;
    color: #bdc1c6;
    height: 100vh;
    overflow-y: auto;
    font-family: 'Roboto', arial, sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
}

.google-results-header {
    border-bottom: 1px solid #3c4043;
    padding: 20px 0 0 0;
}

.header-top {
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 30px;
}

.google-logo-small {
    height: 30px;
}

.header-search-wrap {
    background: #303134;
    border: 1px solid transparent;
    box-shadow: none;
    border-radius: 24px;
    display: flex;
    flex: 1;
    max-width: 692px;
    height: 44px;
    padding: 0 20px;
    align-items: center;
}

.header-search-wrap input {
    background: transparent;
    border: none;
    color: #e8eaed;
    flex: 1;
    font-size: 16px;
    padding: 0 10px;
    outline: none;
}

.header-tabs {
    padding: 20px 0 0 180px;
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.header-tabs .tab {
    padding-bottom: 10px;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: #9aa0a6;
}

.header-tabs .tab.active {
    color: #8ab4f8;
    border-bottom-color: #8ab4f8;
}

.results-container {
    max-width: 652px;
    margin-left: 180px;
    padding-top: 20px;
}

.calc-widget {
    background: #202124;
    border: 1px solid #3c4043;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.calc-display {
    background: #202124;
    border: 1px solid #3c4043;
    border-radius: 8px;
    height: 60px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 0 15px;
}

.calc-history {
    font-size: 12px;
    color: #9aa0a6;
    height: 15px;
}

.calc-current {
    font-size: 30px;
    color: #e8eaed;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calc-btn {
    background: #3c4043;
    border: none;
    border-radius: 4px;
    color: #e8eaed;
    height: 36px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-btn:hover {
    background: #4f5357;
}

.calc-btn.digit {
    background: #303134;
}

.calc-btn.digit:hover {
    background: #3c4043;
}

.calc-btn.blue {
    background: #8ab4f8;
    color: #202124;
}

.calc-btn.blue:hover {
    background: #aecbfa;
}

.fake-result {
    margin-bottom: 28px;
}

.fake-result .cite {
    font-size: 14px;
    color: #bdc1c6;
    margin-bottom: 4px;
    display: block;
}

.fake-result h3 {
    color: #8ab4f8;
    font-size: 20px;
    font-weight: normal;
    margin: 0 0 4px 0;
}

.fake-result p {
    font-size: 14px;
    line-height: 1.58;
    color: #bdc1c6;
    margin: 0;
}

/* ========================================
   GOOGLE HOME & MOBILE OPTIMIZATION
======================================== */
#google-home {
    background: #202124;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10001;
}

.google-home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 584px;
}

.google-main-logo {
    width: 272px;
    margin-bottom: 30px;
}

.home-search-wrap {
    width: 100%;
    background: #303134;
    border: 1px solid #5f6368;
    border-radius: 24px;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
}

.home-search-wrap input {
    background: transparent;
    border: none;
    flex: 1;
    color: #e8eaed;
    font-size: 16px;
    outline: none;
}

.home-buttons {
    margin-top: 30px;
    display: flex;
    gap: 12px;
}

.home-buttons button {
    background: #303134;
    border: 1px solid transparent;
    color: #e8eaed;
    padding: 0 16px;
    height: 36px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.home-buttons button:hover {
    border-color: #5f6368;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .header-top { padding: 0 15px; gap: 15px; }
    .header-tabs { padding-left: 20px; }
    .results-container { margin-left: 15px; margin-right: 15px; }
    
    .navbar { 
        flex-direction: column; 
        height: auto; 
        padding: 10px;
        gap: 10px;
    }
    
    .nav-center { order: 3; width: 100%; }
    .nav-right { width: 100%; justify-content: space-between; }
    
    #posts-grid {
        grid-template-columns: 1fr !important;
        padding: 10px;
    }
    
    .calc-buttons {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .calc-btn { height: 44px; }
    
    .card { margin-bottom: 20px; }
    
    .google-main-logo { width: 160px; }
}
