/* === VARIABEL & TEMA (iOS Palette) === */
:root {
  /* Base Colors - Light */
  --bg-color: #f2f2f7;
  --card-bg: #ffffff;
  --text-color: #1c1c1e;
  --text-muted: #8e8e93;
  --border-color: #e5e5ea; /* Lebih soft */

  /* Brand */
  --primary-color: #007aff;
  --primary-hover: #0062cc;
  --accent-bg: #f2f2f7;
  --success-color: #34c759;
  --error-color: #ff3b30;
  --warn-color: #ff9500;

  /* Glass & Shadows */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.1);

  /* Modal */
  --modal-overlay: rgba(0, 0, 0, 0.2);
  --modal-bg: #ffffff;
}

:root[data-theme="dark"] {
  /* Base Colors - Dark */
  --bg-color: #000000;
  --card-bg: #1c1c1e;
  --text-color: #ffffff;
  --text-muted: #98989d;
  --border-color: #38383a;

  --primary-color: #0a84ff;
  --primary-hover: #409cff;
  --accent-bg: #2c2c2e;

  --glass-bg: rgba(28, 28, 30, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

  --modal-overlay: rgba(0, 0, 0, 0.6);
  --modal-bg: #1c1c1e;
}

* {
  box-sizing: border-box;
  transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s, color 0.3s, transform 0.2s;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased; /* Font lebih tajam ala Mac */
}

/* === UTILITY CLASSES (Unified Design) === */
/* Container Tools */
.tool-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Card Soft (Borderless) */
.card-soft {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent; /* Utk transisi dark mode */
}

:root[data-theme="dark"] .card-soft {
  border: 1px solid var(--border-color);
}

/* Input Soft */
.input-soft {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.95rem;
  transition: 0.2s;
}

.input-soft:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Button Soft */
.btn-action {
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--success-color);
  color: var(--success-color);
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--success-color);
  color: white;
}

/* Upload Zone Modern */
.upload-modern {
  border: 2px dashed var(--border-color);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-color);
  transition: 0.2s;
  position: relative;
}
.upload-modern:hover,
.upload-modern.active {
  border-color: var(--primary-color);
  background: rgba(0, 122, 255, 0.05);
}

/* === iOS FLOATING NAVBAR === */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem; /* Gap antar elemen */

  /* Floating Position */
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 2rem)); /* Max width tapi responsive */

  /* iOS Glassmorphism */
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  /* Border & Shape */
  border: 1px solid var(--glass-border);
  border-radius: 100px; /* Pill Shape */
  padding: 0.6rem 1.2rem;

  /* Shadow */
  box-shadow: var(--glass-shadow);
  z-index: 1000;
  transition: all 0.3s ease;
}

/* Logo Styling */
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px; /* Jarak antara Icon dan Teks */
}

.logo:hover svg {
  transform: scale(1.05);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
  border-radius: 9px;
}

.logo svg {
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 9px;
}

/* LOGO ANIMATION */
.logo-circuit {
  stroke-dasharray: 20;
  stroke-dashoffset: 100;
  animation: flow 3s linear infinite;
}

.logo-dot {
  animation: pulse-white 2s infinite ease-in-out;
  transform-origin: center;
  transform-box: fill-box;
}
.logo-dot:nth-child(2) {
  animation-delay: 1s;
}

@keyframes flow {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
@keyframes pulse-white {
  0%,
  100% {
    r: 2;
    opacity: 1;
  }
  50% {
    r: 2.5;
    opacity: 0.5;
  }
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}
.logo-text span {
  color: var(--primary-color);
  font-weight: 400;
}

/* === HEADER CENTER (Dynamic Island) === */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.dynamic-island {
  display: flex;
  align-items: center;
  background-color: rgba(120, 120, 128, 0.1);
  border-radius: 100px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  gap: 8px;
}

.dynamic-island:hover {
  background-color: rgba(120, 120, 128, 0.18);
  border-color: var(--border-color);
  transform: scale(1.01);
}

/* Fun Eyes Animation */
.fun-eyes {
  display: flex;
  gap: 4px;
  padding: 0 4px;
  height: 14px;
  align-items: center;
}
.eye {
  width: 6px;
  height: 8px;
  background-color: var(--text-color);
  border-radius: 10px;
  position: relative;
  animation: blink 4s infinite;
}
.eye::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 1px;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0.6;
}
@keyframes blink {
  0%,
  48%,
  52%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.1);
  }
}

/* Search Trigger */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.search-trigger kbd {
  background: rgba(120, 120, 128, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: inherit;
  font-weight: 600;
}

/* === RIGHT ACTIONS === */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(120, 120, 128, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}
.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Icon Button Base */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.icon-btn:hover {
  background-color: var(--accent-bg);
  transform: scale(1.1);
}
.icon-btn.active {
  background-color: var(--primary-color);
  color: white;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

/* Menu Button Morphing */
.icon-btn.tool-menu-btn {
  position: relative;
  overflow: hidden;
}
.icon-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-grid {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}
.icon-close {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0) rotate(-90deg);
}

.icon-btn.active .icon-grid {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0) rotate(90deg);
}
.icon-btn.active .icon-close {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* Theme Icons */
.icon-sun {
  display: block;
}
.icon-moon {
  display: none;
}
:root[data-theme="dark"] .icon-sun {
  display: none;
}
:root[data-theme="dark"] .icon-moon {
  display: block;
}

/* === SPOTLIGHT SEARCH MODAL === */
.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}
.search-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-modal {
  width: 90%;
  max-width: 600px;
  background: var(--modal-bg);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.search-modal-overlay.show .search-modal {
  transform: scale(1);
}

.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.search-header input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.1rem;
  color: var(--text-color);
  font-weight: 500;
}
.esc-badge {
  background: var(--bg-color);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.search-body {
  padding: 20px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Animation Loading Search */
.search-loading-state {
  text-align: center;
}
.spinner-search {
  width: 30px;
  height: 30px;
  margin: 0 auto 15px auto;
  border: 3px solid var(--accent-bg);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.search-result-empty {
  text-align: center;
  animation: fadeInUp 0.3s ease;
}
.btn-fun {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--accent-bg);
  border: none;
  border-radius: 8px;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
}
.btn-fun:hover {
  background: var(--border-color);
}

/* === TOOLS POPUP === */
.tools-popup {
  position: fixed;
  top: 85px;
  right: calc(50% - min(600px, calc(50% - 1rem)) + 1.5rem);
  width: 300px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 0.8rem;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95) translateY(-10px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (max-width: 1250px) {
  .tools-popup {
    right: 2rem;
  }
}
.tools-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.popup-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.5rem;
  display: flex;
  justify-content: space-between;
}
.tools-grid-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tool-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-color);
  transition: 0.2s;
}
.tool-item-link:hover {
  background-color: var(--accent-bg);
}
.tool-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

/* Icon Colors */
.tool-item-link:nth-child(1) .tool-icon-box {
  background: #007aff;
}
.tool-item-link:nth-child(2) .tool-icon-box {
  background: #34c759;
}
.tool-item-link:nth-child(3) .tool-icon-box {
  background: #ff9500;
}
.tool-item-link:nth-child(4) .tool-icon-box {
  background: #af52de;
}
.tool-item-link:nth-child(5) .tool-icon-box {
  background: #8e8e93;
}
.tool-item-link:nth-child(6) .tool-icon-box {
  background: #ff2d55;
} /* About */

.tool-info div:first-child {
  font-weight: 600;
  font-size: 0.95rem;
}
.tool-info div:last-child {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Watermark */
.watermark {
  position: fixed;
  bottom: 15px;
  right: 20px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
}

/* Padding Fix */
.app-container {
  padding-top: 100px !important;
}
.hero {
  padding-top: 10rem !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .app-header {
    width: calc(100% - 1.5rem);
    padding: 0.5rem 0.8rem;
    top: 0.8rem;
  }
  .logo-text {
    display: none;
  }
  .search-trigger span,
  .search-trigger kbd {
    display: none;
  }
  .search-trigger {
    padding-right: 0;
  }
  .status-pill {
    display: none;
  }
  .tools-popup {
    width: 90%;
    right: 5%;
    left: 5%;
    top: 75px;
  }
  .search-modal {
    width: 90%;
  }
}

/* ... existing code ... */

/* === DOCS MODAL (Contextual Help) === */
.docs-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.docs-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.docs-modal {
  background: var(--card-bg);
  width: 90%;
  max-width: 500px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 80vh;
}

.docs-modal-overlay.show .docs-modal {
  transform: scale(1);
}

.docs-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.docs-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-header h3::before {
  content: "📘";
}

.close-docs {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.close-docs:hover {
  background: var(--accent-bg);
  color: var(--text-color);
}

.docs-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.6;
}

.docs-body ul,
.docs-body ol {
  padding-left: 1.2rem;
  margin: 1rem 0;
}

.docs-body li {
  margin-bottom: 0.5rem;
}

.docs-body strong {
  color: var(--primary-color);
}
