/**
 * Main Stylesheet for Quick Accounting Documentation Site
 * Provides base styles for the template system components
 */

:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --light-bg: #f8f9fa;
  --border-color: #dee2e6;
  --text-color: #333;
  --text-muted: #6c757d;
  --sidebar-width: 300px;
  --header-height: 60px;
}

/* ============================================
   Base Styles
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-color);
  background-color: #fff;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ============================================
   Header Styles
   ============================================ */

.header {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  padding: 0.75rem 0;
}

.navbar-brand {
  font-weight: 600;
  color: var(--text-color) !important;
  font-size: 1.25rem;
}

.navbar-brand .sitename {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

.navbar-brand img {
  max-height: 40px;
  margin-right: 0.5rem;
}

.nav-link {
  color: var(--text-color) !important;
  transition: color 0.3s ease;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

.nav-link.active {
  color: var(--primary-color) !important;
  border-bottom: 2px solid var(--primary-color);
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.75rem;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: 2px solid var(--primary-color);
}

.dropdown-menu {
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  color: var(--text-color);
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background-color: var(--light-bg);
  color: var(--primary-color);
}

.dropdown-item.active {
  background-color: var(--primary-color);
  color: #fff;
}

/* ============================================
   Sidebar Styles
   ============================================ */

.sidebar {
  background-color: var(--light-bg);
  border-right: 1px solid var(--border-color);
  padding: 20px 0;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-title {
  padding: 0 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.sidebar-toggle {
  background: none;
  border: none;
  padding: 0 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
  width: 100%;
  text-align: left;
  letter-spacing: 0.5px;
}

.sidebar-toggle:hover {
  color: var(--primary-color);
}

.sidebar-toggle.active {
  color: var(--primary-color);
}

.sidebar-toggle i {
  transition: transform 0.3s ease;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-menu.expanded {
  max-height: 1000px;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: block;
  padding: 8px 20px;
  padding-left: 40px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  font-size: 0.95rem;
}

.sidebar-menu a:hover {
  background-color: #e9ecef;
  color: var(--primary-color);
  padding-left: 45px;
}

.sidebar-menu a.active {
  background-color: #e7f3ff;
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  font-weight: 500;
}

.sidebar-link {
  display: block;
  padding: 8px 20px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.sidebar-link:hover {
  color: var(--primary-color);
  padding-left: 25px;
}

/* ============================================
   Main Content Styles
   ============================================ */

.container-fluid {
  padding: 0;
}

main {
  padding: 30px 20px;
}

article {
  max-width: 900px;
}

article h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color);
}

article h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

article h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

article p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-color);
}

article a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

article a:hover {
  color: #0056b3;
  text-decoration: underline;
}

article code {
  background-color: var(--light-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #d63384;
}

article pre {
  background-color: #f5f5f5;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 15px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

article pre code {
  background-color: transparent;
  padding: 0;
  color: var(--text-color);
}

/* ============================================
   Breadcrumb Styles
   ============================================ */

nav[aria-label="breadcrumb"] {
  margin-bottom: 20px;
}

.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--text-color);
}

/* ============================================
   Footer Styles
   ============================================ */

.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background-color: #2c3e50;
  color: #ecf0f1;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
  font-size: 1rem;
}

.footer-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #bdc3c7;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-contact {
  list-style: none;
  padding: 0;
}

.footer-contact li {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #bdc3c7;
}

.footer-contact i {
  margin-top: 2px;
  flex-shrink: 0;
}

.footer-contact a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-contact a:hover {
  color: #fff;
}

/* ============================================
   Utility Classes
   ============================================ */

.text-muted {
  color: var(--text-muted) !important;
}

.bg-light {
  background-color: var(--light-bg) !important;
}

.border-bottom {
  border-bottom: 1px solid var(--border-color) !important;
}

/* ============================================
   Scrollbar Styles
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}
