:root {
  /* Light theme (default) */
  --bg-primary: #fffaf5;
  --bg-secondary: #ffffff;
  --text-primary: #2d2416;
  --text-secondary: #5a4c3b;
  --accent: #ff5722;
  --accent-hover: #e64a19;
  --border: #fde4cd;
  --shadow: rgba(255, 87, 34, 0.08);
  --header-bg: rgba(255, 255, 255, 0.85);
  --sidebar-bg: var(--bg-secondary);
  --sidebar-active-bg: #fff0e6;
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  
  /* Animation duration - slightly faster */
  --theme-transition: 0.2s;
  /* --old-accent: #ff9800; */
}

[data-theme='dark'] {
  --bg-primary: #1a120b;
  --bg-secondary: #241811;
  --text-primary: #f5efe7;
  --text-secondary: #d1c4b1;
  --accent: #ff7043;
  --accent-hover: #ff8a65;
  --border: #3d2b1f;
  --shadow: rgba(255, 112, 67, 0.2);
  --header-bg: rgba(36, 24, 17, 0.9);
  --sidebar-bg: var(--bg-secondary);
  --sidebar-active-bg: #32251d;
  /* --bg-primary: #181818; */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* border: 1px solid red; */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--theme-transition), color var(--theme-transition);
  font-size: 16px; /* Slightly larger base font size */
  line-height: 1.7; /* Improved line height for readability */
  /* Add will-change for potentially smoother background transitions */
  will-change: background-color, color;
  /* background-image: url('bg.png'); */
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px; /* Slightly shorter header */
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px 0 var(--shadow); /* Add subtle shadow instead of just border */
  border-bottom: none; /* Remove border */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px; /* More horizontal padding */
  z-index: 100;
  transition: background var(--theme-transition), border-color var(--theme-transition);
  /* Add will-change for potentially smoother header transitions */
  will-change: background, border-color;
  /* border-bottom: 2px solid var(--accent); */
}

.header-title {
  font-weight: 600;
  font-size: 1.2rem; /* Slightly larger title */
  letter-spacing: -0.03em;
  /* text-transform: uppercase; */
}

/* Theme Toggle Switch */
.theme-switch {
  position: relative;
  width: 56px;
  height: 28px;
  display: inline-block;
  /* margin-left: 20px; */
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  /* Slightly faster slider transition */
  transition: background-color var(--theme-transition), border-color var(--theme-transition);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-shadow: 0 2px 6px var(--shadow);
  /* background: linear-gradient(90deg, #fff, #ffe0b2); */
}

.slider:before {
  position: absolute;
  content: "🌙";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 2px;
  background-color: var(--accent);
  border-radius: 50%;
  /* Faster knob transition with easing */
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color var(--theme-transition);
  font-size: 12px;
  /* box-shadow: 0 0 8px var(--accent); */
}

input:checked + .slider:before {
  transform: translateX(26px);
  content: "☀️";
}

.moon-icon, .sun-icon {
  font-size: 14px;
  line-height: 1;
  z-index: 1;
  transition: opacity 0.2s;
  user-select: none;
}

.moon-icon {
  opacity: 0;
  /* color: #ffeb3b; */
}

input:checked + .slider .sun-icon {
  opacity: 0;
}

input:checked + .slider .moon-icon {
  opacity: 1;
}

.sidebar {
  position: fixed;
  top: 60px; /* Adjust top position due to shorter header */
  left: 0;
  width: 72px; /* Slightly wider sidebar */
  height: calc(100% - 60px);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
  gap: 16px;
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), 
              background var(--theme-transition),
              border-color var(--theme-transition);
  z-index: 90;
  /* Add will-change for potentially smoother sidebar transitions */
  will-change: background, border-color;
  /* box-shadow: 2px 0 8px var(--shadow); */
}

.sidebar a {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.3rem; /* Larger icons */
  width: 52px;
  height: 52px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  /* border: 1px dashed #ccc; */
}

.sidebar a:hover {
  color: var(--text-primary);
  background: var(--sidebar-active-bg);
  transform: scale(1.05); /* Add slight scale on hover */
}

.sidebar a.active {
  color: var(--accent);
  background: var(--sidebar-active-bg);
  /* Make active state more distinct */
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.sidebar a.active::before {
  /* Remove the side line indicator */
  display: none;
}

.main-content {
  margin-left: 72px; /* Adjust margin for wider sidebar */
  margin-top: 60px; /* Adjust margin for shorter header */
  padding: 40px 32px; /* More padding */
  max-width: 1100px;
  /* min-height: 80vh; */
}

.main-content h1 {
  font-size: 2.8rem; /* Larger H1 */
  font-weight: 700;
  letter-spacing: -0.05em;
  margin-bottom: 32px;
  background: linear-gradient(90deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* text-shadow: 1px 1px 0 var(--accent); */
}

.main-content h2 {
  font-size: 1.8rem; /* Larger H2 */
  font-weight: 600;
  margin-bottom: 24px; /* Increased margin below H2 */
  color: var(--accent);
  letter-spacing: -0.03em;
  padding-bottom: 8px; /* Add padding below H2 */
  border-bottom: 1px solid var(--border); /* Add a subtle separator line */
}

.main-content h3 {
  font-size: 1.35rem; /* Style H3 directly */
  margin-top: 32px; /* Add space above H3 */
  margin-bottom: 12px; /* Reduce space below H3 */
  color: var(--text-primary);
  font-weight: 600; /* Make H3 bolder */
  /* letter-spacing: 0.02em; */
}

.main-content p {
  font-size: 1.05rem; /* Slightly larger paragraph text */
  margin-bottom: 24px;
  color: var(--text-secondary);
  max-width: 75ch; /* Limit line length for readability */
  /* text-align: justify; */
}

.section {
  margin-bottom: 64px; /* Increased space between sections */
  /* border-bottom: 1px solid #eee; */
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80vh;
  text-align: center;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-message {
  font-size: 1.5rem;
  margin-bottom: 32px;
}

.back-button {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease;
  /* border: none; */
}

.back-button:hover {
  background: var(--accent-hover);
}

ul {
  list-style-position: inside;
  margin-bottom: 24px;
  /* padding-left: 20px; */
}

li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  /* font-style: italic; */
}

/* Contact Form Styles */
.contact-form {
  background-color: var(--bg-secondary);
  padding: 24px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border);
  max-width: 600px;
  box-shadow: 0 4px 12px var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.2);
}

.submit-button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.submit-button:hover {
  background-color: var(--accent-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 0 16px; /* Adjust padding for mobile */
    /* font-size: 0.95rem; */
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    height: 64px; /* Slightly taller bottom bar */
    flex-direction: row;
    justify-content: space-around;
    padding: 0;
    border-top: 1px solid var(--border);
    border-right: none;
    /* box-shadow: 0 -2px 8px var(--shadow); */
  }
  
  .sidebar a {
    margin: 0;
    height: 64px;
    width: 64px;
    font-size: 1.4rem;
  }
  
  .sidebar a.active {
     box-shadow: none; /* Remove inset shadow on mobile */
  }

  .sidebar a.active::before {
    /* Restore bottom line indicator for mobile */
    display: block;
    left: 20px;
    right: 20px;
    top: auto;
    bottom: 0;
    width: auto;
    height: 3px;
  }
  
  .main-content {
    margin-left: 0;
    margin-bottom: 64px; /* Adjust for taller bottom bar */
    padding: 32px 16px;
    /* min-width: 0; */
  }
}
