/* ===================================================
   NAWALA LINKTREE - MODERN DESIGN SYSTEM & STYLES
   =================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Primary Theme: Telur Asin Cerah & Segar (Bright Duck Egg / Pastel Mint Cyan) */
  --bg-main: #eef8f6;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: #ffffff;
  --border-card: rgba(135, 219, 207, 0.45);
  --border-card-hover: #26a69a;
  
  --text-primary: #0f3732;
  --text-secondary: #27655d;
  --text-muted: #5e958d;

  /* Bright Telur Asin Palette Accents */
  --accent-primary: #14b8a6;
  --accent-secondary: #2dd4bf;
  --accent-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #5eead4 100%);
  --glow-color-1: rgba(45, 212, 191, 0.35);
  --glow-color-2: rgba(94, 234, 212, 0.4);
  --glow-color-3: rgba(153, 246, 228, 0.35);

  --badge-new-bg: rgba(20, 184, 166, 0.16);
  --badge-new-text: #0d9488;
  --badge-new-border: rgba(20, 184, 166, 0.35);

  --badge-old-bg: rgba(148, 163, 184, 0.16);
  --badge-old-text: #64748b;
  --badge-old-border: rgba(148, 163, 184, 0.3);

  --badge-type-bg: rgba(45, 212, 191, 0.18);
  --badge-type-text: #0f766e;

  --icon-drive-color: #0284c7;
  --icon-drive-bg: rgba(14, 165, 233, 0.14);
  --icon-sheets-color: #059669;
  --icon-sheets-bg: rgba(16, 185, 129, 0.14);
  --icon-folder-color: #d97706;
  --icon-folder-bg: rgba(245, 158, 11, 0.14);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-card: 0 6px 24px -4px rgba(13, 148, 136, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 16px 32px -4px rgba(20, 184, 166, 0.22);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Mode: Telur Asin Deep Ocean Night */
  --bg-main: #061614;
  --bg-card: rgba(13, 35, 33, 0.8);
  --bg-card-hover: rgba(18, 48, 45, 0.95);
  --border-card: rgba(94, 234, 212, 0.15);
  --border-card-hover: #2dd4bf;

  --text-primary: #f0fdfa;
  --text-secondary: #99f6e4;
  --text-muted: #5eead4;

  --accent-primary: #2dd4bf;
  --accent-secondary: #5eead4;
  --accent-gradient: linear-gradient(135deg, #0d9488 0%, #2dd4bf 50%, #99f6e4 100%);
  --glow-color-1: rgba(20, 184, 166, 0.25);
  --glow-color-2: rgba(45, 212, 191, 0.2);
  --glow-color-3: rgba(94, 234, 212, 0.15);

  --badge-new-bg: rgba(45, 212, 191, 0.2);
  --badge-new-text: #5eead4;
  --badge-new-border: rgba(94, 234, 212, 0.4);

  --badge-old-bg: rgba(148, 163, 184, 0.15);
  --badge-old-text: #94a3b8;
  --badge-old-border: rgba(148, 163, 184, 0.25);

  --badge-type-bg: rgba(20, 184, 166, 0.2);
  --badge-type-text: #5eead4;

  --shadow-card: 0 4px 22px -2px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 12px 30px -4px rgba(45, 212, 191, 0.35);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2.5rem 1rem;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: var(--glow-color-1);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
}

.glow-2 {
  width: 380px;
  height: 380px;
  background: var(--glow-color-2);
  top: 40%;
  right: -100px;
}

.glow-3 {
  width: 320px;
  height: 320px;
  background: var(--glow-color-3);
  bottom: 50px;
  left: -80px;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 720px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header / Profile Card */
.profile-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem 1.8rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.theme-switch-wrapper {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
}

.icon-btn {
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  background: rgba(20, 184, 166, 0.18);
  border-color: var(--border-card-hover);
  transform: scale(1.05);
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

/* Avatar with gradient border */
.avatar-wrapper {
  margin-bottom: 1rem;
}

.avatar-ring {
  width: 82px;
  height: 82px;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  box-shadow: 0 0 24px rgba(20, 184, 166, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-core {
  width: 100%;
  height: 100%;
  background: var(--bg-main);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-text {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.profile-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.profile-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin-bottom: 1.5rem;
}

/* Search Box */
.search-box {
  width: 100%;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 2.8rem;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.06);
}

[data-theme="dark"] .search-box input {
  background: rgba(8, 26, 24, 0.85);
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.clear-btn {
  position: absolute;
  right: 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.clear-btn:hover {
  color: var(--text-primary);
}

/* Filter Tags */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

[data-theme="dark"] .filter-tab {
  background: rgba(13, 35, 33, 0.6);
}

.filter-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-card-hover);
  background: rgba(20, 184, 166, 0.12);
}

.filter-tab.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(20, 184, 166, 0.35);
}

/* Sections Wrapper */
.sections-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Link Category Section */
.link-category {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 0.25rem;
}

.category-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon-box svg {
  width: 20px;
  height: 20px;
}

.cat-book {
  background: rgba(20, 184, 166, 0.18);
  color: #0d9488;
}

.cat-nawala {
  background: rgba(14, 165, 233, 0.18);
  color: #0284c7;
}

.cat-ijp {
  background: rgba(16, 185, 129, 0.18);
  color: #059669;
}

.category-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.category-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sub-group-title {
  padding: 0.25rem 0.25rem 0;
}

.sub-badge-new {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.sub-badge-old {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.mt-4 {
  margin-top: 0.75rem;
}

/* Cards Grid */
.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Link Card */
.link-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  display: flex;
  align-items: stretch;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-card-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-hover);
}

.link-card.highlight-glow {
  border-left: 4px solid var(--accent-primary);
}

.link-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
}

/* Icons within cards */
.link-icon-container {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.link-card:hover .link-icon-container {
  transform: scale(1.08);
}

.link-icon-container svg {
  width: 24px;
  height: 24px;
}

.icon-drive {
  background: var(--icon-drive-bg);
  color: var(--icon-drive-color);
}

.icon-sheets {
  background: var(--icon-sheets-bg);
  color: var(--icon-sheets-color);
}

.icon-folder {
  background: var(--icon-folder-bg);
  color: var(--icon-folder-color);
}

/* Link Details */
.link-details {
  flex: 1;
  min-width: 0;
}

.link-header-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-baru {
  background: var(--badge-new-bg);
  color: var(--badge-new-text);
  border: 1px solid var(--badge-new-border);
}

.badge-lama {
  background: var(--badge-old-bg);
  color: var(--badge-old-text);
  border: 1px solid var(--badge-old-border);
}

.badge-type {
  background: var(--badge-type-bg);
  color: var(--badge-type-text);
}

.badge-sub {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.link-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

/* Action button (arrow) */
.link-action {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  transition: var(--transition);
}

.arrow-icon {
  width: 20px;
  height: 20px;
  transition: var(--transition);
}

.link-card:hover .arrow-icon {
  color: var(--accent-primary);
  transform: translate(2px, -2px);
}

/* Copy Link Button */
.copy-btn {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border-card);
  padding: 0 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.copy-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.copy-btn.copied {
  color: #34d399;
}

/* Empty State / No Results */
.no-results {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-md);
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.no-results h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.no-results p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f2e2a;
  color: #e6faf7;
  border: 1px solid #4ecdba;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(78, 205, 186, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 1rem;
  padding-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-tip {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  body {
    padding: 1.25rem 0.75rem;
  }

  .profile-card {
    padding: 2rem 1.25rem 1.5rem;
  }

  .profile-title {
    font-size: 1.4rem;
  }

  .profile-subtitle {
    font-size: 0.85rem;
  }

  .link-card-body {
    padding: 0.9rem 1rem;
    gap: 0.85rem;
  }

  .link-icon-container {
    width: 38px;
    height: 38px;
  }

  .copy-btn {
    padding: 0 0.85rem;
  }

  .link-title {
    font-size: 0.92rem;
  }

  .link-desc {
    font-size: 0.78rem;
  }
}
