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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0d1117;
  color: #e6edf3;
  line-height: 1.6;
}

a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #60a5fa;
}

/* Container & Layout */
.container {
  display: flex;
  min-height: 100vh;
  background: #0d1117;
}

/* Sidebar Navigation (VSCode Style) */
.sidebar {
  width: 280px;
  background: #252526;
  color: #e0e0e0;
  overflow-y: auto;
  border-right: 1px solid #3e3e42;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid #3e3e42;
  background: #1e1e1e;
}

.site-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: block;
  text-decoration: none;
  transition: color 0.3s;
  cursor: pointer;
}

.site-logo:hover {
  color: #3b82f6;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 0.5rem;
}

.nav-section-title {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #cfcfcf;
  background: #2a2a2a;
  border-left: 4px solid transparent;
  text-transform: none;
  cursor: default;
  transition: background 0.2s, color 0.2s;
}

.nav-section-title:hover {
  color: #ffffff;
  background: #333333;
}

.icon {
  margin-right: 0.5rem;
}

.nav-items {
  list-style: none;
  padding: 0;
}

.nav-items li {
  margin-left: 0.25rem;
}

.nav-items .nav-link {
  padding-left: 2rem;
}

.nav-link {
  display: block;
  padding: 0.5rem 1.5rem;
  color: #ccc;
  font-size: 0.95rem;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  background: #2d2d30;
  color: #fff;
  border-left-color: #3b82f6;
}

.nav-link.active {
  background: #3e3e42;
  color: #fff;
  border-left-color: #3b82f6;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #3e3e42;
  background: #1e1e1e;
}

.text-sm {
  font-size: 0.85rem;
  color: #858585;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  background: #0d1117;
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

/* Home Button */
.home-button {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  background: #161b22;
  color: #3b82f6;
  border: 2px solid #30363d;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
}

.home-button:hover {
  background: #21262d;
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Mobile Menu Toggle Button */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  background: #1f2937;
  color: #3b82f6;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.toggle-icon {
  width: 24px;
  height: 24px;
  stroke: #3b82f6;
  stroke-width: 2;
}

.sidebar-toggle:hover {
  background: #374151;
  border-color: #60a5fa;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.sidebar-toggle:active {
  transform: translateY(0);
  background: #4b5563;
  border-color: #3b82f6;
}

/* When sidebar is open, change button style */
.sidebar-open .sidebar-toggle {
  background: #1f2937;
  color: #60a5fa;
  border-color: #60a5fa;
}

.sidebar-open .toggle-icon {
  stroke: #60a5fa;
}

/* Free Tool Banner */
.free-banner {
  display: inline-block;
  background: #1f6feb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-align: center;
  width: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

  .main-content {
    margin-left: 240px;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    position: relative;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease-out;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
    padding: 1rem;
    width: 100%;
    min-height: 100vh;
  }

  .sidebar-toggle {
    display: flex;
  }

  .content-wrapper {
    padding-top: 1rem;
  }

  /* Overlay when sidebar is open */
  .sidebar-open .sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  }

  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.3s ease-out;
  }

  body.sidebar-open::after {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 1rem 0.75rem;
  }

  .sidebar {
    width: 100%;
  }

  .content-wrapper {
    max-width: 100%;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 0.75rem 0.5rem;
  }

  .sidebar-toggle {
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .content-wrapper {
    padding-top: 1.5rem;
  }
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: #252526;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #464647;
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #565657;
}

/* Print Styles */
@media print {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }
}
