/* ── Theme Variables ── */
:root {
  --bg-primary:       #ffffff;
  --bg-secondary:     #f9fafb;
  --bg-tertiary:      #f3f4f6;
  --bg-card:          #ffffff;
  --text-primary:     #111827;
  --text-secondary:   #4b5563;
  --text-muted:       #6b7280;
  --text-hint:        #9ca3af;
  --border-primary:   #e5e7eb;
  --border-secondary: #d1d5db;
  --teal:             #0d9488;
  --teal-hover:       #0f766e;
  --teal-light:       #f0fdf9;
  --teal-border:      #99f6e4;
  --navbar-bg:        #ffffff;
  --navbar-border:    #f3f4f6;
  --input-bg:         #f9fafb;
  --drop-zone-bg:     #f9fafb;
  --result-bg:        #f0fdf9;
  --shadow:           rgba(0,0,0,0.08);
  --hero-bg:          #e6faf6;
  --stats-bg:         #f9fafb;
}

[data-theme="dark"] {
  --bg-primary:       #111827;
  --bg-secondary:     #1f2937;
  --bg-tertiary:      #1a2433;
  --bg-card:          #1f2937;
  --text-primary:     #f9fafb;
  --text-secondary:   #d1d5db;
  --text-muted:       #9ca3af;
  --text-hint:        #6b7280;
  --border-primary:   #374151;
  --border-secondary: #4b5563;
  --teal:             #0d9488;
  --teal-hover:       #14b8a6;
  --teal-light:       #0d2420;
  --teal-border:      #134e4a;
  --navbar-bg:        #1f2937;
  --navbar-border:    #374151;
  --input-bg:         #111827;
  --drop-zone-bg:     #1a2433;
  --result-bg:        #0d2420;
  --shadow:           rgba(0,0,0,0.3);
  --hero-bg:          #0d2420;
  --stats-bg:         #1a2433;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary:       #111827;
    --bg-secondary:     #1f2937;
    --bg-tertiary:      #1a2433;
    --bg-card:          #1f2937;
    --text-primary:     #f9fafb;
    --text-secondary:   #d1d5db;
    --text-muted:       #9ca3af;
    --text-hint:        #6b7280;
    --border-primary:   #374151;
    --border-secondary: #4b5563;
    --teal:             #0d9488;
    --teal-hover:       #14b8a6;
    --teal-light:       #0d2420;
    --teal-border:      #134e4a;
    --navbar-bg:        #1f2937;
    --navbar-border:    #374151;
    --input-bg:         #111827;
    --drop-zone-bg:     #1a2433;
    --result-bg:        #0d2420;
    --shadow:           rgba(0,0,0,0.3);
    --hero-bg:          #0d2420;
    --stats-bg:         #1a2433;
  }
}

/* =========================================
   Reset
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

a {
  text-decoration: none;
  color: inherit;
}

@font-face {
  font-family: "RussoOne";
  src: url("/fonts/RussoOne-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* =========================================
   Navbar
   ========================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  padding: 1rem 1.5rem;
  transition: background 0.2s, border-color 0.2s;
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  font-family: "RussoOne", sans-serif;
}

.navbar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--teal);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.navbar-links a:hover { color: var(--text-primary); }

.btn-nav-signup {
  background: var(--teal);
  color: #ffffff !important;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s !important;
}

.btn-nav-signup:hover {
  background: var(--teal-hover) !important;
  color: #ffffff !important;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.navbar-user:hover { background: var(--bg-tertiary); }

.navbar-username {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-nav-logout {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-nav-logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Theme toggle */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.theme-toggle-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-light);
}

/* =========================================
   Buttons
   ========================================= */
.btn-primary {
  display: inline-block;
  background: var(--teal);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--teal-hover);
  color: #ffffff;
}

.btn-secondary {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--border-secondary);
  color: var(--text-primary);
}

.btn-full {
  width: 100%;
  text-align: center;
}

/* =========================================
   Hero
   ========================================= */
.hero {
  width: 100%;
  background: var(--hero-bg);
  padding: 80px 0;
  transition: background 0.2s;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-left {
  flex: 1;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--teal);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero h1 span { color: var(--teal); }

.hero p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 460px;
}

.hero-buttons {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.hero-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.hero-visual {
  position: relative;
  width: 420px;
  height: 380px;
}

.hero-card {
  position: absolute;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.125rem 1.25rem;
  box-shadow: 0 8px 30px var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 200px;
}

.hero-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.hero-card-text { display: flex; flex-direction: column; }

.hero-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-card-sub {
  font-size: 0.75rem;
  color: var(--text-hint);
  margin-top: 2px;
}

.hero-card-progress {
  height: 4px;
  background: var(--border-primary);
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
}

.hero-card-progress-bar {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}

.hero-card:nth-child(1) { top: 0; left: 20px; }
.hero-card:nth-child(2) { top: 100px; left: 120px; }
.hero-card:nth-child(3) { top: 200px; left: 30px; }
.hero-card:nth-child(4) { top: 290px; left: 150px; }

.hero-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.12;
}

.hero-dot-1 { width: 80px; height: 80px; top: -20px; right: 20px; }
.hero-dot-2 { width: 40px; height: 40px; bottom: 40px; right: 0; opacity: 0.08; }
.hero-dot-3 { width: 20px; height: 20px; top: 160px; right: 80px; opacity: 0.15; }

@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    padding: 0 24px;
  }
  .hero-left { align-items: center; max-width: 100%; }
  .hero p { max-width: 100%; }
  .hero-buttons { justify-content: center; }
  .hero-right { justify-content: center; width: 100%; }
  .hero-visual { width: 340px; height: 320px; }
  .hero-card { min-width: 170px; }
}

@media (max-width: 480px) {
  .hero { padding: 50px 0; }
  .hero h1 { font-size: 2rem; }
  .hero-visual { display: none; }
}

/* =========================================
   Stats Bar
   ========================================= */
.stats-bar {
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
  background: var(--stats-bg);
  padding: 2rem 1.5rem;
  transition: background 0.2s;
}

.stats-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .stats-inner { grid-template-columns: repeat(4, 1fr); }
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--teal);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-hint);
  margin-top: 0.25rem;
}

/* =========================================
   Tools Section
   ========================================= */
.tools-section {
  padding: 5rem 1.5rem;
  background: var(--bg-card);
  transition: background 0.2s;
}

.tools-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-hint);
  text-align: center;
  margin-bottom: 2.5rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s;
  display: block;
}

.tool-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.tool-icon {
  width: 44px;
  height: 44px;
  background: var(--teal-light);
  color: var(--teal);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.25rem;
}

.tool-card h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tool-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================================
   CTA Banner
   ========================================= */
.cta-banner {
  background: var(--teal);
  color: #ffffff;
  text-align: center;
  padding: 4rem 1.5rem;
}

.cta-banner h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.cta-banner p {
  font-size: 0.875rem;
  color: #99f6e4;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.btn-cta {
  display: inline-block;
  background: #ffffff;
  color: var(--teal);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-cta:hover {
  background: var(--teal-light);
  color: var(--teal);
}

/* =========================================
   Footer
   ========================================= */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-primary);
  padding: 2.5rem 1.5rem;
  transition: background 0.2s;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  font-family: "RussoOne", sans-serif;
}

.footer-logo-icon {
  width: 24px;
  height: 24px;
  background: var(--teal);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--teal); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-hint);
}

/* =========================================
   Tool Pages
   ========================================= */
.page-wrapper {
  min-height: calc(100vh - 64px);
  background: var(--bg-secondary);
  padding: 2rem 1.5rem;
  transition: background 0.2s;
}

.tool-box {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 2rem;
  transition: background 0.2s, border-color 0.2s;
}

.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--teal);
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}

.back-link:hover { color: var(--teal-hover); }

.tool-box h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tool-box .tool-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--input-bg);
  transition: border-color 0.15s, background 0.2s;
  outline: none;
}

.form-input:focus { border-color: var(--teal); }

.form-range {
  width: 100%;
  margin-top: 0.25rem;
  accent-color: var(--teal);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-hint);
  margin-top: 0.25rem;
}

.status-text {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.result-box {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--result-bg);
  border: 1px solid var(--teal-border);
  border-radius: 10px;
  text-align: center;
  transition: background 0.2s;
}

.result-box p {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 0.75rem;
}

.btn-download {
  display: inline-block;
  background: var(--teal);
  color: #ffffff;
  padding: 0.625rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-download:hover { background: var(--teal-hover); color: #ffffff; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-secondary);
  border-radius: 10px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--drop-zone-bg);
  margin-bottom: 1.25rem;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--teal);
  background: var(--teal-light);
}

.drop-zone i {
  font-size: 2rem;
  color: var(--text-hint);
  display: block;
  margin-bottom: 0.75rem;
}

.drop-zone p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.drop-zone small {
  font-size: 0.8125rem;
  color: var(--text-hint);
}

.drop-zone input[type="file"] { display: none; }

.file-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--teal-light);
  border: 1px solid var(--teal-border);
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.file-selected i { color: var(--teal); font-size: 1.25rem; }

.file-selected span {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-selected button {
  background: none;
  border: none;
  color: var(--text-hint);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

.file-selected button:hover { color: #dc2626; }

.tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .tool-layout { grid-template-columns: 1fr 1fr; }
}

/* =========================================
   Auth Pages
   ========================================= */
.auth-wrapper {
  min-height: 100vh;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 2rem;
}

.auth-box h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.auth-box .auth-desc {
  font-size: 0.875rem;
  color: var(--text-hint);
  margin-bottom: 1.5rem;
}

.auth-footer-text {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

.auth-footer-text a { color: var(--teal); font-weight: 500; }
.auth-footer-text a:hover { color: var(--teal-hover); }

.form-error { font-size: 0.8125rem; color: #dc2626; margin-top: 0.375rem; }
.form-success { font-size: 0.8125rem; color: var(--teal); margin-top: 0.375rem; }

/* =========================================
   Avatar Upload
   ========================================= */
.avatar-upload-wrapper {
  position: relative;
  width: 72px;
  margin: 0 auto 1rem;
  cursor: pointer;
}

.avatar-upload-wrapper img,
.avatar-upload-wrapper .profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
  font-size: 1.25rem;
}

.avatar-upload-wrapper:hover .avatar-overlay { opacity: 1; }
.avatar-upload-input { display: none; }

.avatar-saving {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  text-align: center;
  min-height: 1rem;
}

/* =========================================
   Grid helper
   ========================================= */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* =========================================
   Responsive — Mobile
   ========================================= */
@media (max-width: 640px) {
  .navbar-links a:not(.btn-nav-signup):not(:last-child) {
    display: none;
  }

  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 0.9375rem; }

  .tool-box {
    padding: 1.25rem;
    border-radius: 8px;
  }

  .tool-box h1 { font-size: 1.375rem; }
  .two-col-grid { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .cta-banner h2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .hero { padding: 50px 0; }
  .page-wrapper { padding: 1rem; }
  .tool-box { padding: 1rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-box { max-width: 680px; }
}

/* =========================================
   Masonry GIF Grid
   ========================================= */
.gif-grid-masonry {
  columns: 4;
  column-gap: 12px;
}

.gif-grid-masonry .gif-card {
  break-inside: avoid;
  margin-bottom: 12px;
  display: inline-block;
  width: 100%;
}

.gif-grid-masonry .gif-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: unset;
}

@media (max-width: 1024px) { .gif-grid-masonry { columns: 3; } }
@media (max-width: 640px)  { .gif-grid-masonry { columns: 2; } }
@media (max-width: 400px)  { .gif-grid-masonry { columns: 1; } }

/* =========================================
   Notification Bell
   ========================================= */
.notif-bell-wrapper { position: relative; }

.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.25rem;
  padding: 0.375rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.notif-bell-btn:hover { background: var(--bg-tertiary); }

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #dc2626;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--navbar-bg);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -80px;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  box-shadow: 0 10px 40px var(--shadow);
  z-index: 999;
  overflow: hidden;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-primary);
}

.notif-dropdown-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-mark-all {
  font-size: 0.8125rem;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  padding: 0;
  transition: color 0.15s;
}

.notif-mark-all:hover { color: var(--teal-hover); }

.notif-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  border-bottom: 1px solid var(--border-primary);
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-tertiary); }
.notif-item.unread { background: var(--teal-light); }
.notif-item.unread:hover { background: var(--teal-light); }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  flex-shrink: 0;
}

.notif-item-body { flex: 1; min-width: 0; }

.notif-msg {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.notif-time {
  font-size: 0.75rem;
  color: var(--text-hint);
}

.notif-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin-top: 4px;
}

.notif-loading,
.notif-empty {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: var(--text-hint);
}

.notif-view-all {
  display: block;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--teal);
  border-top: 1px solid var(--border-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.notif-view-all:hover { background: var(--teal-light); }

@media (max-width: 480px) {
  .notif-dropdown { right: -120px; width: 300px; }
}

/* =========================================
   Live Preview Box
   ========================================= */
.live-preview-wrapper {
  margin: 1rem 0 1.5rem;
  display: none;
}

.live-preview-box {
  background: #111827;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-primary);
}

.live-preview-img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.live-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background: #1f2937;
  font-size: 0.8125rem;
  color: #9ca3af;
  gap: 1rem;
}

/* =========================================
   Browse / Category buttons
   ========================================= */
.browse-header { background: var(--bg-card); }

.category-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 1rem;
  transition: all 0.15s;
}

.category-btn:hover,
.category-btn.active {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal);
}

/* =========================================
   Profile
   ========================================= */
.profile-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-primary);
  transition: background 0.2s;
}

.profile-username { color: var(--text-primary); }
.profile-email    { color: var(--text-muted); }
.profile-about    { color: var(--text-secondary); }
.profile-tabs     { border-bottom-color: var(--border-primary); }
.profile-tab-btn  { color: var(--text-muted); }
.profile-tab-btn:hover  { color: var(--teal); }
.profile-tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }

/* =========================================
   Dividers
   ========================================= */
.divider,
hr { border-color: var(--border-primary); }

/* =========================================
   GIF Cards
   ========================================= */
.gif-card {
  background: var(--bg-card);
  border-color: var(--border-primary);
  transition: background 0.2s, border-color 0.2s;
}

.gif-card-title { color: var(--text-primary); }
.gif-card-meta  { color: var(--text-hint); }

/* =========================================
   Action buttons (gif.html sidebar)
   ========================================= */
.btn-action-secondary {
  background: var(--bg-secondary);
  border-color: var(--border-primary);
  color: var(--text-primary);
}

.btn-action-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-like {
  background: var(--bg-secondary);
  border-color: var(--border-primary);
  color: var(--text-primary);
}

.btn-copy-link {
  background: var(--bg-tertiary);
  border-color: var(--border-primary);
  color: var(--text-primary);
}

.btn-copy-link:hover { background: var(--bg-secondary); }


@media (max-width: 480px) {
  .navbar-logo {
    font-size: 0.875rem;
  }

  .navbar-logo-icon img,
  .navbar-logo-icon i {
    width: 18px;
    height: 18px;
    font-size: 18px;
  }
}