/* 0flufThemes.css - Consolidated Theme Engine v1.7.0 */

/* =========================================
   1. GLOBAL VARIABLES (DEFAULT: OLED DARK)
   ========================================= */
:root {
  --bg: #000000;
  --card: #141418;
  --card-hover: #1e1e24;
  --text: #ffffff;
  --accent: #00aaff;
  --dim: #888;
  --border: #333;
  --delete: #ff4d4d;
  --radius: 12px;
  --font-main:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --shadow: none;
}

/* =========================================
   2. STANDARD THEME OVERRIDES
   ========================================= */

body.light {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-hover: #e5e5ea;
  --text: #000000;
  --accent: #007aff;
  --dim: #8e8e93;
  --border: #d1d1d6;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.cyberpunk {
  --bg: #050505;
  --card: #121212;
  --card-hover: #1a1a1a;
  --text: #00ff41;
  --accent: #f0e600;
  --dim: #008f11;
  --border: #333;
  --delete: #ff003c;
  --radius: 0px;
  --font-main: "Courier New", Courier, monospace;
  --shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

body.sunset {
  --bg: #2d1b2e;
  --card: #442646;
  --card-hover: #583350;
  --text: #ffd166;
  --accent: #ef476f;
  --dim: #b892b0;
  --border: #6d4b68;
  --radius: 20px;
}

body.forest {
  --bg: #1a2f1a;
  --card: #2d4c2d;
  --card-hover: #3a5c3a;
  --text: #e1efe1;
  --accent: #c3e6c3;
  --dim: #a4bfa4;
  --border: #3a5c3a;
  --radius: 16px;
}

body.paper {
  --bg: #f9f7f2;
  --card: rgba(255, 255, 255, 0.8);
  --card-hover: rgba(0, 0, 0, 0.03);
  --text: #1a1a1a;
  --accent: #222222;
  --dim: #777777;
  --border: #d1cfc8;
  --radius: 2px;
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body.luminous {
  --bg: #0f172a;
  --card: #1e293b;
  --card-hover: #334155;
  --text: #f8fafc;
  --accent: #38bdf8;
  --dim: #94a3b8;
  --border: #475569;
}

body.nord {
  --bg: #2e3440;
  --card: rgba(59, 66, 82, 0.7);
  --card-hover: rgba(67, 76, 94, 0.9);
  --text: #eceff4;
  --accent: #88c0d0;
  --dim: #d8dee9;
  --border: #4c566a;
  --radius: 16px;
}

body.dracula {
  --bg: #282a36;
  --card: #44475a;
  --card-hover: #6272a4;
  --text: #f8f8f2;
  --accent: #bd93f9;
  --dim: #6272a4;
  --border: #44475a;
}

body.retro {
  --bg: #0d0202;
  --card: #1a0505;
  --card-hover: #260808;
  --text: #ffb000;
  --accent: #ffb000;
  --dim: #7f5800;
  --border: #ffb000;
  --radius: 0px;
}

body.rose {
  --bg: #191724;
  --card: #1f1d2e;
  --card-hover: #26233a;
  --text: #e0def4;
  --accent: #ebbcba;
  --dim: #908caa;
  --border: #403d52;
}

body.heatwave {
  --bg: #1b0d05;
  --card: rgba(60, 20, 0, 0.6);
  --card-hover: rgba(255, 95, 0, 0.15);
  --text: #f5e6ca;
  --accent: #ff5f00;
  --dim: #a67c52;
  --border: rgba(255, 95, 0, 0.3);
  --radius: 4px;
}

body.slate {
  --bg: #1a1a1a;
  --card: rgba(45, 45, 45, 0.6);
  --card-hover: rgba(255, 215, 0, 0.1);
  --text: #d1d1d1;
  --accent: #ffd700;
  --dim: #888888;
  --border: rgba(255, 215, 0, 0.3);
  --radius: 0px;
}

body.toxic-tide {
  --bg: #041614;
  --card: rgba(15, 45, 40, 0.5);
  --card-hover: rgba(47, 191, 162, 0.1);
  --text: #f4f19b;
  --accent: #2fbfa2;
  --dim: #5c8a82;
  --border: rgba(47, 191, 162, 0.3);
  --radius: 8px;
}

body.evergreen-archive {
  --bg: #1a2416;
  --card: rgba(72, 96, 52, 0.6);
  --card-hover: rgba(72, 96, 52, 0.8);
  --text: #d9c588;
  --accent: #d9c588;
  --dim: #764d44;
  --border: #764d44;
}

/* --- NEW: Material You Fallback --- */
/* (This ensures the layout holds together even before JS injects the colors) */
body.material-you {
  --bg: #1e1e1e;
  --card: rgba(40, 40, 40, 0.6);
  --card-hover: rgba(55, 55, 55, 0.8);
  --text: #e0e0e0;
  --accent: #a8c7fa;
  --dim: #888888;
  --border: #444444;
  --radius: 24px;
}

/* =========================================
   3. ADAPTIVE CLOCK STYLES
   ========================================= */
.clock {
  transition: all 0.3s ease;
}
.clock-style-default {
  font-weight: 300;
}
.clock-style-bold {
  font-weight: 900;
  letter-spacing: -2px;
}
.clock-style-serif {
  font-family: "Georgia", serif;
  font-weight: bold;
}
.clock-style-mono {
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
}
.clock-style-lcd {
  font-family: "Courier New", monospace;
  text-shadow: 0 0 5px var(--accent);
  color: var(--accent);
}
.clock-style-neon {
  color: #fff;
  text-shadow:
    0 0 5px #fff,
    0 0 15px var(--accent),
    0 0 30px var(--accent),
    0 0 50px var(--accent);
}
.clock-style-minimal {
  font-weight: 100;
  opacity: 0.7;
}
.clock-style-block {
  background: var(--card);
  padding: 5px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: max-content;
  display: inline-block;
}

/* =========================================
   4. SHAPE-BASED MORPHING ENGINE v2.1
   ========================================= */
.link-item {
  transition: transform 0.2s ease;
}
.link-item:hover {
  transform: translateY(-2px);
}

.link-icon-circle {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  border-radius: var(--radius);
}

/* --- CATEGORY A: THE SHARP SET (Ghost Effect) --- */
body.retro .link-icon-circle,
body.cyberpunk .link-icon-circle,
body.paper .link-icon-circle,
body.slate .link-icon-circle,
body.toxic-tide .link-icon-circle,
body.heatwave .link-icon-circle {
  border-radius: var(--radius);
}

body.retro .link-item:hover .link-icon-circle,
body.cyberpunk .link-item:hover .link-icon-circle,
body.paper .link-item:hover .link-icon-circle,
body.slate .link-item:hover .link-icon-circle,
body.toxic-tide .link-item:hover .link-icon-circle,
body.heatwave .link-item:hover .link-icon-circle {
  background: transparent !important;
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

body.retro .link-item:hover .link-icon-circle span,
body.cyberpunk .link-item:hover .link-icon-circle span,
body.paper .link-item:hover .link-icon-circle span,
body.slate .link-item:hover .link-icon-circle span,
body.toxic-tide .link-item:hover .link-icon-circle span,
body.heatwave .link-item:hover .link-icon-circle span {
  color: var(--accent) !important;
}

/* --- CATEGORY B: THE SQUIRCLES (Premium Soft Morph) --- */
body.forest .link-icon-circle,
body.rose .link-icon-circle,
body.luminous .link-icon-circle,
body.light .link-icon-circle {
  border-radius: 40%;
}

body.forest .link-item:hover .link-icon-circle,
body.rose .link-item:hover .link-icon-circle,
body.luminous .link-item:hover .link-icon-circle,
body.light .link-item:hover .link-icon-circle {
  border-radius: 50%;
  background-color: transparent;
  border: 2px solid var(--accent);
  transform: scale(1.05);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

body.forest .link-item:hover .link-icon-circle span,
body.rose .link-item:hover .link-icon-circle span,
body.luminous .link-item:hover .link-icon-circle span,
body.light .link-item:hover .link-icon-circle span {
  color: var(--accent) !important;
}

/* --- CATEGORY C: THE CIRCLES (Blur & Tilt Flip) --- */
body.evergreen-archive .link-icon-circle,
body.nord .link-icon-circle,
body.sunset .link-icon-circle,
body.nebula-drift .link-icon-circle,
body.night-glow .link-icon-circle,
body.material-you .link-icon-circle {
  border-radius: 50%;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.evergreen-archive .link-item:hover .link-icon-circle,
body.nord .link-item:hover .link-icon-circle,
body.sunset .link-item:hover .link-icon-circle,
body.nebula-drift .link-item:hover .link-icon-circle,
body.night-glow .link-item:hover .link-icon-circle,
body.material-you .link-item:hover .link-icon-circle {
  background: var(--text);
  transform: rotate(3deg) scale(1.05);
  border: 2px solid transparent;
}

body.evergreen-archive .link-item:hover .link-icon-circle span,
body.nord .link-item:hover .link-icon-circle span,
body.sunset .link-item:hover .link-icon-circle span,
body.nebula-drift .link-item:hover .link-icon-circle span,
body.night-glow .link-item:hover .link-icon-circle span,
body.material-you .link-item:hover .link-icon-circle span {
  color: var(--bg) !important;
}

/* =========================================
   5. BACKGROUND IMAGE SUPPORT
   ========================================= */
body {
  background-color: var(--bg);
  color: var(--text);
  transition:
    background-color 0.3s,
    color 0.3s;
  position: relative;
  z-index: 1;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

/* =========================================
   6. ADVANCED GLASSMORPHISM THEMES
   ========================================= */

body.night-glow {
  --bg: #000000;
  --fg: #ffffff;
  --accent: #ffffff;
  --card: rgba(0, 0, 0, 0.9);
  --card-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.4);
  --dim: #aaaaaa;
  --delete: #ff4444;
}

body.night-glow .clock,
body.night-glow .greeting,
body.night-glow .link-name,
body.night-glow h2,
body.night-glow h3 {
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(255, 255, 255, 0.3);
}

body.night-glow .search-bar,
body.night-glow .link-icon-circle,
body.night-glow .modal-content,
body.night-glow input,
body.night-glow select {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border);
  background: #000000;
}

body.night-glow .clock.clock-style-neon {
  text-shadow:
    0 0 5px #fff,
    0 0 15px #fff,
    0 0 30px rgba(255, 255, 255, 0.8),
    0 0 60px rgba(255, 255, 255, 0.5);
}

body.night-glow .link-item:hover .link-icon-circle {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  border-color: #ffffff;
}

body.nebula-drift {
  --bg: #1f1b2e;
  background-image: linear-gradient(135deg, #1f1b2e 0%, #16213e 100%);
  background-attachment: fixed;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: #fdfcff;
  --dim: #a3a9c2;
  --accent: #00e5ff;
  --delete: #ff4a8d;
}

body.nebula-drift .modal-content,
body.nebula-drift .engine-dropdown,
body.nebula-drift .search-bar,
body.nebula-drift .link-icon-circle {
  background: rgba(35, 30, 55, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.nebula-drift .clock.clock-style-neon {
  color: #fff;
  text-shadow:
    0 0 5px #fff,
    0 0 15px #00e5ff,
    0 0 30px #00e5ff,
    0 0 60px #b088f9;
}

/* =========================================
   7. FIXES & PERFORMANCE PATCHES
   ========================================= */
.search-bar,
.search-container {
  position: relative;
  z-index: 1000 !important;
  transform: translateZ(0);
}

.modal-content,
.floating-settings {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform, scroll-position;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.modal-content {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
