/*----------------------------------------------------------
  Layout Components
----------------------------------------------------------*/

/* Main Content */
#maincontent {
  margin-left: var(--sidebar-width);
  padding: 0;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
  max-width: 100%;
  overflow-x: hidden;
}

/* Full-viewport cursor spotlight overlay */
.cursor-spotlight {
  display: none !important;
  /* Disabled: distracting glow on hover */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(
    600px circle at var(--cursor-x) var(--cursor-y),
    rgba(78, 204, 163, 0.07),
    transparent 40%
  );
  transition: opacity 0.3s ease;
}

/* Custom cursor */
.custom-cursor {
  display: none !important;
  /* Disabled: distracting cursor ring */
  position: fixed;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.6;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease,
              border-color 0.3s ease,
              background-color 0.3s ease;
  mix-blend-mode: difference;
  will-change: transform;
}

.custom-cursor.cursor-hover {
  width: 60px;
  height: 60px;
  top: -30px;
  left: -30px;
  opacity: 0.4;
  background-color: rgba(78, 204, 163, 0.08);
  border-color: var(--accent-dark);
}

.custom-cursor-dot {
  display: none !important;
  position: fixed;
  top: -3px;
  left: -3px;
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  will-change: transform;
}

/* Hide custom cursor on touch/mobile */
@media (pointer: coarse) {
  .custom-cursor,
  .custom-cursor-dot,
  .cursor-spotlight {
  display: none !important;
  /* Disabled: distracting glow on hover */
    display: none !important;
  }
}

/* Hide default cursor when custom cursor is active */
@media (pointer: fine) {
  body {
    cursor: auto;
  }
  a, button, .btn, .bento-card, .project-card, .skill-category, .tag {
    cursor: pointer;
  }
}

/* Premium Sidebar Navigation */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding-top: 2.5rem;
  overflow-y: auto;
  z-index: 1000;
  text-align: left;
  box-shadow: var(--shadow-md);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#sidebar::-webkit-scrollbar {
  width: 5px;
}

#sidebar::-webkit-scrollbar-track {
  background: var(--background-tertiary);
}

#sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

.profile-pic {
  margin: 0 auto 2rem;
  text-align: center;
  padding: 0 25px;
  position: relative;
}

.profile-pic::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78, 204, 163, 0.15) 0%, transparent 70%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.profile-pic:hover::after {
  opacity: 1;
}

.profile-pic img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
  border: 3px solid transparent;
  box-shadow: var(--shadow-md), 0 0 0 2px var(--accent);
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: grayscale(15%);
}

.profile-pic img:hover {
  transform: scale(1.05);
  filter: grayscale(0%);
  box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent-dark);
}

.theme-toggle-container {
  display: flex;
  justify-content: center;
  padding: 0 20px;
  margin: -0.8rem 0 1.2rem;
}

.theme-toggle-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--background-elevated);
  border-radius: var(--radius-full);
  background: var(--background-secondary);
  color: var(--foreground-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-medium);
}

.theme-toggle-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-toggle-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

/* Show/hide theme icons based on current theme */
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }
[data-theme="light"] .theme-icon-light { display: inline; }
[data-theme="light"] .theme-icon-dark { display: none; }

/* Animated transition for theme switch */
html {
  transition: background-color 0.4s ease, color 0.4s ease;
}

html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.4s ease,
              color 0.4s ease,
              border-color 0.4s ease,
              box-shadow 0.4s ease !important;
}

#sidebar .nav-header {
  margin-bottom: 2.2rem;
  padding: 0 20px;
}

#sidebar .nav-header h2 {
  font-size: 1.4rem;
  margin: 0;
  text-align: center;
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

#sidebar .nav-header h2::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 2px;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(to right, var(--accent), var(--accent-dark));
  border-radius: var(--radius-full);
}

#sidebar ul {
  list-style: none;
  padding-left: 0;
  margin-top: 2rem;
}

#sidebar ul li {
  margin: 0.5rem 0;
  padding: 0 18px;
}

#sidebar ul li a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 0.9rem 1.2rem;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 100%;
  border-radius: var(--radius-md);
  color: var(--foreground-secondary);
  font-weight: 500;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#sidebar ul li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--accent-lighter) 0%,
    rgba(78, 204, 163, 0.03) 100%
  );
  z-index: -1;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

#sidebar ul li a:hover::before,
#sidebar ul li a.active::before {
  transform: translateX(0);
}

#sidebar ul li a:hover,
#sidebar ul li a.active {
  color: var(--accent);
}

#sidebar ul li a.active {
  border-left: 3px solid var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Numbered nav items */
.nav-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-right: 12px;
  opacity: 0.7;
  font-weight: 500;
  min-width: 22px;
}

.nav-item:hover .nav-number {
  opacity: 1;
}

/* Section number prefix */
.section-number {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  margin-right: 0.5rem;
  font-weight: 500;
  opacity: 0.8;
}

/* Style icons within menu items */
.nav-item svg {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  transition: transform 0.3s ease;
}

.nav-item:hover svg {
  transform: translateX(2px);
  color: var(--accent);
}

/* Light theme sidebar */
[data-theme="light"] #sidebar {
  background: rgba(255, 255, 255, 0.85);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .custom-cursor {
  display: none !important;
  /* Disabled: distracting cursor ring */
  border-color: var(--accent);
  mix-blend-mode: normal;
}

[data-theme="light"] footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .mobile-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] footer p {
  color: var(--foreground-tertiary);
}

[data-theme="light"] .footer-links a {
  color: var(--foreground-tertiary);
}

/* Mobile Header & Responsive Sidebar */
.mobile-header {
  display: none;
  background: var(--background-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 1rem;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

.mobile-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

.mobile-header .logo {
  font-size: 1.5rem;
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.mobile-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  padding: 0.5rem;
  border-radius: 4px;
  transition: var(--transition-medium);
}

.mobile-header button:hover {
  background-color: var(--background-tertiary);
}

/* Hamburger Menu */
.hamburger {
  padding: 10px;
  display: inline-block;
  cursor: pointer;
  transition: var(--transition-medium);
  background-color: transparent;
  border: none;
  margin: 0;
}

.hamburger:hover {
  opacity: 0.8;
}

.hamburger-box {
  width: 30px;
  height: 20px;
  display: inline-block;
  position: relative;
  z-index: 6;
}

.hamburger-inner {
  position: absolute;
  top: 50%;
  margin-top: -2px;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
  border-radius: 4px;
  transition: var(--transition-medium);
}

.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
  border-radius: 4px;
  transition: var(--transition-medium);
}

.hamburger-inner::before {
  top: -8px;
}

.hamburger-inner::after {
  bottom: -8px;
}

/* Hamburger animation when active */
.hamburger-inner.active {
  transform: rotate(45deg);
}

.hamburger-inner.active::before {
  top: 0;
  transform: rotate(90deg);
}

.hamburger-inner.active::after {
  bottom: 0;
  opacity: 0;
}

/* Sidebar overlay for mobile */
#sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1999;
}

#sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  background-color: var(--background-secondary);
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer .container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--foreground-tertiary);
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  padding: 0;
}

.footer-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-links a svg {
  width: 20px;
  height: 20px;
}

.footer-links a::after {
  display: none;
}

footer p {
  color: var(--foreground-tertiary);
  font-size: 0.85rem;
  margin: 0;
  text-align: center;
  width: 100%;
}
