@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #fcfcfb;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --active-bg: #ebebeb;
  --hover-bg: #f4f4f3;
  --dark-hero: #111111;

  --text: #141414;
  --text-sub: #333333;
  --text-muted: #6b6b6b;
  --text-dim: #999999;

  --border: #ededec;
  --border-light: #f0f0ee;

  --accent-orange: #ff5722;
  --accent-green: #15803d;
  --badge-green-bg: #e6f7ec;

  --radius-card: 16px;
  --radius-pill: 999px;
  --radius-sm: 8px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --bg: #0e0e0e;
  --sidebar-bg: #151515;
  --card-bg: #181818;
  --active-bg: #272727;
  --hover-bg: #202020;
  --dark-hero: #000000;

  --text: #f5f5f5;
  --text-sub: #d6d6d6;
  --text-muted: #9c9c9c;
  --text-dim: #6d6d6d;

  --border: #282828;
  --border-light: #212121;

  --accent-orange: #ff6a3d;
  --accent-green: #22c55e;
  --badge-green-bg: rgba(34, 197, 94, 0.15);

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.55);
}

/* Global Theme Transition */
body,
.sidebar,
.main,
.apps-banner-card,
.project-card,
.search-input,
.about-card,
.nav-link,
.btn-open,
.theme-toggle,
.floating-icon {
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

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

html,
body {
  height: 100%;
  width: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: auto;
}

/* ========================================================
   SIDEBAR
   ======================================================== */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-light);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
}

.brand {
  display: flex;
  align-items: center;
  padding: 20px 12px 30px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-right: 20px;
}

.brand-logo-img {
  height: 60px;
  width: auto;
  max-width: px;
  object-fit: contain;
  display: block;
  transition: opacity 0.15s ease;
}

.brand-link:hover .brand-logo-img {
  opacity: 0.82;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: #373737;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}

.nav-link:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.nav-link.active {
  background: var(--active-bg);
  color: var(--text);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f4f4f3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid #ffffff;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.copyright {
  font-size: 12px;
  color: var(--text-dim);
  padding: 0 8px;
}

/* ========================================================
   MAIN CONTENT AREA
   ======================================================== */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 36px 48px 64px;
  scroll-behavior: smooth;
  background: var(--bg);
}

.page-container {
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 24px;
  color: var(--text);
}

/* ========================================================
   APPS BANNER (EXACT HEADER CARD ABOVE SEARCH)
   ======================================================== */
.apps-banner-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  min-height: 140px;
}

.apps-banner-content {
  max-width: 480px;
  position: relative;
  z-index: 2;
}

.apps-banner-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 6px;
}

.apps-banner-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.apps-banner-illustration {
  position: relative;
  width: 280px;
  height: 130px;
  flex-shrink: 0;
}

.sphere-graphic {
  position: absolute;
  right: -24px;
  bottom: -46px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #60a5fa 0%, #3b82f6 50%, #1d4ed8 90%, #172554 100%);
  opacity: 0.85;
  filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.28));
}

.floating-icon {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.2s ease;
}

.floating-icon:hover {
  transform: translateY(-2px) scale(1.08);
}

.floating-icon svg {
  width: 18px;
  height: 18px;
}

/* Floating positions matching screenshot */
.floating-icon.pos-notion {
  top: 12px;
  right: 28px;
}

.floating-icon.pos-docs {
  top: 48px;
  right: 90px;
}

.floating-icon.pos-drive {
  bottom: 12px;
  right: 125px;
}

.floating-icon.pos-github {
  top: 14px;
  right: 152px;
}

.floating-icon.pos-linear {
  top: 44px;
  right: 195px;
}

.floating-icon.pos-excel {
  bottom: 8px;
  right: 205px;
}

.floating-icon.pos-hub {
  top: 0px;
  right: 86px;
  width: 20px;
  height: 20px;
}

/* ========================================================
   SEARCH & SECTION HEADERS
   ======================================================== */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

.search-icon {
  position: absolute;
  left: 16px;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 12px 20px 12px 42px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: #bbbbba;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.section-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* ========================================================
   PROJECT CARDS (DEV IMPERIAL HORIZONTAL CARD STYLE)
   ======================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.project-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fdfdfd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-icon svg {
  width: 32px;
  height: 32px;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.project-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Button (Exact pill button look) */
.btn-open {
  background: var(--hover-bg);
  color: var(--text);
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.btn-open:hover {
  background: var(--active-bg);
  transform: scale(1.02);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--card-bg);
  grid-column: 1 / -1;
}

/* ========================================================
   ABOUT ME VIEW
   ======================================================== */
.about-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 38px 42px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.about-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #fcfcfb;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-subtle);
}

.about-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.about-role {
  color: var(--accent-orange);
  font-weight: 600;
  font-size: 14.5px;
}

.about-bio {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-sub);
  white-space: pre-line;
}

.about-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.skills-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-tag {
  background: var(--hover-bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.links-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.link-btn {
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--card-bg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.link-btn svg {
  width: 15px;
  height: 15px;
}

.link-btn:hover {
  background: var(--hover-bg);
  border-color: #d8d8d7;
  transform: translateY(-1px);
}

/* ========================================================
   TOP-RIGHT THEME TOGGLE (SUN & HALF-MOON)
   ======================================================== */
.top-actions {
  position: fixed;
  top: 20px;
  right: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  width: 64px;
  height: 32px;
  outline: none;
}

.theme-toggle:hover {
  border-color: #8c8c8a;
  box-shadow: var(--shadow-hover);
}

.toggle-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
  color: var(--text-dim);
  transition: color 0.2s ease, transform 0.2s ease;
}

.toggle-icon svg {
  width: 15px;
  height: 15px;
}

/* Sliding active pill indicator */
.toggle-pill {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--active-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
  z-index: 1;
}

/* Light mode state: sun is highlighted */
[data-theme="light"] .theme-toggle .toggle-sun {
  color: #ff5722;
}

/* Dark mode state: moon is highlighted, pill glides right */
[data-theme="dark"] .theme-toggle .toggle-pill {
  transform: translateX(32px);
  background: #2d2d2d;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .theme-toggle .toggle-moon {
  color: #60a5fa;
}

/* ========================================================
   DARK MODE COMPONENT OVERRIDES
   ======================================================== */
[data-theme="dark"] .brand-logo-img {
  filter: invert(1) brightness(1.25);
}

[data-theme="dark"] .nav-link {
  color: #a8a8a8;
}

[data-theme="dark"] .nav-link:hover {
  background: var(--hover-bg);
  color: #ffffff;
}

[data-theme="dark"] .nav-link.active {
  background: var(--active-bg);
  color: #ffffff;
}

[data-theme="dark"] .floating-icon {
  background: #242424;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .project-icon {
  background: #232323;
}

[data-theme="dark"] .btn-open {
  background: #252525;
  color: #f5f5f5;
}

[data-theme="dark"] .btn-open:hover {
  background: #333333;
  color: #ffffff;
}

[data-theme="dark"] .search-input {
  color: #f5f5f5;
}

[data-theme="dark"] .search-input:focus {
  border-color: #555555;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .about-avatar-large {
  background: #202020;
  border-color: #2e2e2e;
}

[data-theme="dark"] .user-avatar {
  background: #202020;
  border-color: #2e2e2e;
}

[data-theme="dark"] .avatar-dot {
  border-color: #151515;
}

[data-theme="dark"] .link-btn {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .link-btn:hover {
  background: var(--hover-bg);
  border-color: #444444;
}

[data-theme="dark"] .skill-tag {
  background: var(--hover-bg);
  color: var(--text-sub);
}

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .apps-banner-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
  }

  .apps-banner-illustration {
    width: 100%;
    height: 100px;
  }
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 18px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand {
    padding: 0;
  }

  .brand-logo-img {
    height: 24px;
  }

  .nav {
    flex-direction: row;
    gap: 8px;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 24px 18px 48px;
  }

  .about-card {
    padding: 24px;
  }

  .top-actions {
    top: 14px;
    right: 14px;
  }

  .theme-toggle {
    width: 58px;
    height: 30px;
  }

  .toggle-icon {
    width: 24px;
    height: 24px;
  }

  .toggle-pill {
    width: 24px;
    height: 24px;
  }

  [data-theme="dark"] .theme-toggle .toggle-pill {
    transform: translateX(28px);
  }
}