:root {
  --bg-color: #F4F4F5;
  --text-color: #000000;
  --accent-blue: #2563EB;
  --accent-purple: #7C3AED;
  --accent-pink: #EC4899;
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'Courier New', monospace;
  --panel-bg: rgba(255, 255, 255, 0.4);
  --panel-border: rgba(255, 255, 255, 0.5);
  --muted: rgba(0, 0, 0, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  background-image: radial-gradient(#D4D4D8 1px, transparent 1px);
  background-size: 24px 24px;
}

.hidden { display: none !important; }

/* ═════════ OSTIRO CREATIVE BACKGROUND ═════════ */
.creative-background {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; perspective: 1000px;
}
.geo-shape { position: absolute; opacity: 0.9; display: flex; align-items: center; justify-content: center; animation: float 6s ease-in-out infinite; }
.cube-3d { top: 15%; left: 5%; width: 80px; height: 80px; background: linear-gradient(135deg, var(--accent-blue), #60A5FA); transform: rotate3d(1, 1, 1, 45deg); box-shadow: 10px 10px 20px rgba(37, 99, 235, 0.2); border-radius: 12px; }
.circle-gradient { bottom: 10%; right: 10%; width: 120px; height: 120px; background: radial-gradient(circle at 30% 30%, var(--accent-pink), transparent); background-color: rgba(236, 72, 153, 0.1); border: 2px solid rgba(236, 72, 153, 0.3); border-radius: 50%; animation-delay: 1s; }
.code-bracket-left, .code-bracket-right { font-family: var(--font-mono); font-size: 15rem; color: rgba(0, 0, 0, 0.03); font-weight: 900; }
.code-bracket-left { top: 30%; left: 2%; transform: translateY(-50%); }
.code-bracket-right { top: 30%; right: 2%; transform: translateY(-50%); }
.pill-accent { top: 20%; right: 20%; width: 60px; height: 20px; background-color: var(--accent-purple); border-radius: 50px; transform: rotate(-15deg); animation-duration: 8s; }
.floating-ui { bottom: 25%; left: 15%; width: 140px; height: 90px; background: white; border: 1px solid #E4E4E7; border-radius: 8px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); align-items: flex-start; padding: 10px; gap: 6px; transform: rotate(5deg); animation-delay: 2s; }
.ui-dot { width: 8px; height: 8px; border-radius: 50%; }
.ui-dot.red { background: #EF4444; } .ui-dot.yellow { background: #F59E0B; } .ui-dot.green { background: #10B981; }
.squiggle { top: 60%; right: 30%; width: 80px; height: 20px; color: var(--accent-blue); transform: rotate(10deg); }

@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-20px) rotate(var(--r, 0deg)); } }

/* ── HEADER ── */
header { position: relative; z-index: 10; padding: 2.5rem; display: flex; justify-content: space-between; align-items: center; }
.logo a { color: black; font-size: 1.5rem; transition: 0.3s; text-decoration: none; font-weight: 700;}
.social-links { display: flex; gap: 1.5rem; }
.social-links a { color: black; font-size: 1.2rem; opacity: 0.6; transition: 0.2s; }
.social-links a:hover { opacity: 1; color: var(--accent-blue); }

/* ── APP LAYOUT ── */
.app-layout {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 2rem 6rem;
  min-height: calc(100vh - 85px);
}

.panels-container {
  display: flex;
  width: 100%;
  max-width: 1200px;
  gap: 2rem;
  flex-grow: 1;
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.left-panel {
  width: 550px;
  min-width: 450px;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.5rem;
}
.right-panel {
  flex-grow: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

/* ── LEFT PANEL ELEMENTS ── */
.hero-text { font-weight: 800; text-transform: uppercase; letter-spacing: -0.03em; display:flex; justify-content:center; gap:0.3em; flex-wrap:wrap;}
.hero-text .word { display: inline-flex; }

.input-main { display: flex; width: 100%; border: 2px solid transparent; border-radius: 12px; background: white; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02); transition: 0.3s; }
.input-main:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }
.input-main input { flex-grow: 1; padding: 1rem 1.2rem; font-size: 1rem; border: none; outline: none; background: transparent; font-family: var(--font-main); }

.extract-btn { 
  background-color: var(--text-color); 
  color: white; 
  padding: 0 24px; 
  border-radius: 0 10px 10px 0; 
  font-weight: 600; 
  font-size: 1rem; 
  border: none; 
  cursor: pointer; 
  transition: 0.3s; 
  text-transform: uppercase; 
}
.extract-btn:hover { background-color: var(--accent-blue); }

.cta-button {
    background-color: black;
    color: white;
    padding: 16px 40px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.05em;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    background-color: #111;
    color: white;
}

.screenshot-pane {
  flex-grow: 1;
  position: relative;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #E4E4E7;
}
.browser-bar { background: #F4F4F5; padding: 10px 12px; display: flex; gap: 6px; border-bottom: 1px solid #E4E4E7; }
.screenshot-img-box { position: relative; overflow-y: auto; flex-grow: 1; }
#screenshot-img { width: 100%; display: block; }
.loader-overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(255,255,255,0.8); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; }
.pulse-dot { width: 15px; height: 15px; background: var(--accent-pink); border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(236,72,153,0.4); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.screenshot-placeholder { flex-grow: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.9rem; }

/* ── RIGHT PANEL ELEMENTS ── */
.palette-top-bar {
  background: #111827; /* Following colorize.design topbar dark */
  color: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.palette-top-bar h2 { font-weight: 700; font-size: 1.5rem; }
.top-bar-actions { display: flex; gap: 10px; }
.action-btn {
  background: #1F2937;
  border: 1px solid #374151;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  display: flex; align-items: center; gap: 8px;
}
.action-btn:hover { background: #374151; }
.download-btn-main { border-color: #6B7280; }

.dropdown-wrapper { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; width: 100%;
  background: #1F2937;
  border: 1px solid #374151;
  border-radius: 8px;
  margin-top: 8px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  z-index: 50;
}
.dropdown-menu button {
  background: transparent; border: none; color: #D1D5DB;
  padding: 12px 16px; text-align: left; font-family: inherit; font-size: 0.9rem; cursor: pointer; transition: 0.2s;
}
.dropdown-menu button:hover { background: #374151; color: white; }

.block-header { display: flex; align-items: center; gap: 10px; margin-bottom: 0.5rem; }
.block-header h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.block-header .badge { background: var(--accent-blue); color: white; font-family: var(--font-mono); font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; font-weight: bold; }
.meta-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; border-bottom: 2px solid rgba(0,0,0,0.1); padding-bottom: 1rem; }

.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 3rem;}

/* ── COLOR CARD WAVY ── */
.color-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.color-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.color-swatch-wrap { height: 130px; position: relative; overflow: hidden; }
.swatch-fill { position: absolute; top:0; left:0; width:100%; height:100%; }
.wave-divider { position: absolute; bottom: -1px; left: 0; width: 100%; height: auto; z-index: 2; }
.color-info { padding: 1.25rem; display: flex; flex-direction: column; gap: 6px; }
.color-name { color: #6B7280; font-size: 0.85rem; font-weight: 500; }
.color-rgb { color: #111827; font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.copy-btn {
  background: #F1F5F9; border: none; color: #4B5563; padding: 6px 12px; border-radius: 20px; font-family: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; align-self: flex-start; display: flex; align-items: center; gap: 6px; transition: 0.2s;
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { background: #E2E8F0; color: #111827; }

/* TOAST */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; background: #10B981; color: white; font-weight: 600; padding: 12px 24px; border-radius: 8px; box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3); opacity: 0; transform: translateY(20px); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 9999; display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateY(0); }

.error-msg { background: rgba(239,68,68,0.1); color: #ef4444; padding: 10px; border-radius: 6px; margin-top: 15px; font-size: 0.9rem; font-weight: 600; }

/* --- Floating Arrow (Liquid Glass) --- */
.floating-arrow-left {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-arrow {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-arrow:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    color: var(--accent-blue);
}

/* --- Footer (Tekiyo Style) --- */
.site-footer {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(0, 0, 0, 0.5);
    background: transparent;
}
.site-footer a { color: rgba(0, 0, 0, 0.5); text-decoration: none; transition: color 0.2s ease; }
.site-footer a:hover { color: black; }

.footer-left,
.footer-right { display: flex; gap: 1.5rem; align-items: center; }

.footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.dot { font-weight: bold; }

/* --- Legal Modal (Liquid Glass) --- */
.legal-trigger { background: none; border: none; cursor: pointer; font-size: inherit; font-family: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; transition: color 0.2s ease; }
.legal-trigger:hover { color: black; }
.legal-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; justify-content: center; align-items: center; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; backdrop-filter: blur(0px); }
.legal-modal.active { pointer-events: all; opacity: 1; backdrop-filter: blur(8px); background-color: rgba(0, 0, 0, 0.05); }
.legal-glass-card { width: 90%; max-width: 400px; background: rgba(255, 255, 255, 0.65); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 20px; padding: 3rem; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.5) inset; font-family: 'Courier New', monospace; font-size: 0.85rem; line-height: 1.6; color: #333; transform: scale(0.95) translateY(10px); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; gap: 2rem; }
.legal-modal.active .legal-glass-card { transform: scale(1) translateY(0); }
.legal-header, .legal-footer-note { opacity: 0.7; }
.legal-body { display: flex; flex-direction: column; gap: 0.2rem; }
.section-title { font-weight: 700; text-transform: uppercase; margin-bottom: 0.5rem; letter-spacing: 0.05em; color: #000; }
.legal-glass-card a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(0, 0, 0, 0.2); }
.legal-glass-card a:hover { border-bottom-color: black; }
.header-mail { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--text-color); margin-right: 1rem;}
.header-mail:hover { color: var(--accent-blue); }

/* ── DELETE MODE ── */
body.delete-mode .color-card {
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
body.delete-mode .color-card::after {
  content: "×";
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 10;
}
body.delete-mode .color-card:hover {
  transform: scale(0.95);
  box-shadow: 0 0 0 2px #EF4444, 0 10px 20px rgba(239, 68, 68, 0.2);
}
body.delete-mode .color-card:hover::after {
  opacity: 1;
}

body.delete-mode .copy-btn {
  pointer-events: none;
  opacity: 0.3;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .panels-container {
    flex-direction: column;
  }
  .left-panel {
    width: 100%;
    min-width: 0;
  }
  .app-layout {
    padding-bottom: 8rem; /* space for absolute footer */
  }
}

.action-btn.editing-active {
  background: #EF4444; /* red to indicate destructive mode */
  border-color: #DC2626;
  color: white;
}
.action-btn.editing-active:hover {
  background: #DC2626;
}
