/*
 * Stytch-inspired Documentation with Light Morandi Color Scheme
 */

:root {
  /* Light Morandi Color Palette */
  --background: #f5f3f0;
  --text-primary: #5a5552;
  --text-secondary: #8c8178;
  --accent: #a5b1aa;
  --accent-hover: #94a199;
  --accent-light: #d5ddd8;
  --highlight: #d2c4bc;
  --border: #e0dad3;
  --code-bg: #e8e6e1;
  --sidebar-bg: #f8f7f5;
  --header-bg: rgba(245, 243, 240, 0.95);
  --card-bg: #ffffff;
  --callout-info-bg: #e9eff0;
  --callout-warning-bg: #f8f0e5;
  --callout-danger-bg: #f5e9e9;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 60px;
  --content-width: 768px;
  --footer-height: 80px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif, "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol";
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
               "Courier New", monospace;

  /* Animation */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--background);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 2.25rem;
  margin-top: 0;
}

h2 {
  font-size: 1.15rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

ul, ol {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.5rem;
  border-left: 4px solid var(--accent-light);
  background-color: var(--card-bg);
  color: var(--text-secondary);
  font-style: italic;
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--border);
  margin: 2rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.2em 0.4em;
  background-color: var(--code-bg);
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow: auto;
  margin-bottom: 1.5rem;
}

pre code {
  padding: 0;
  background-color: transparent;
  font-size: 0.875rem;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--sidebar-bg);
  font-weight: 600;
}

/* Layout Styles */
.page-container {
  display: flex;
  min-height: 100vh;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.content {
  flex: 1;
  padding: 2rem;
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
}

.content-container {
  min-width: 0;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
  border-radius: 4px;
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  background-color: var(--code-bg);
}

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

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

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.nav-section.active .section-title {
  color: var(--text-primary);
}

.chevron-icon {
  transition: transform var(--transition-fast);
}

.nav-section.active .chevron-icon {
  transform: rotate(90deg);
}

.section-items {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 0;
  overflow: hidden;
  transition: height var(--transition-normal);
}

.section-items.expanded {
  height: auto;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 0.5rem 1.5rem 0.5rem 2.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  text-decoration: none;
  background-color: var(--accent-light);
}

.nav-item.active .nav-link {
  color: var(--accent);
  background-color: var(--accent-light);
  font-weight: 500;
}

.sidebar-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.sidebar-footer-link:hover {
  color: var(--text-primary);
}

/* Header Styles */
.content-header {
  position: sticky;
  top: 0;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

/* Breadcrumb Styles */
.breadcrumb {
  max-width: var(--content-width);
  width: 100%;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item a {
  color: var(--text-secondary);
}

.breadcrumb-item a:hover {
  color: var(--accent);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumb-separator {
  margin: 0 0.25rem;
  color: var(--text-secondary);
}

/* Document Actions */
.doc-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.edit-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.edit-link:hover {
  color: var(--accent);
}

/* Footer Styles */
.content-footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  background-color: var(--sidebar-bg);
}

.footer-content {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.version-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Callouts */
.callout {
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  border-left: 4px solid;
}

.callout-info {
  background-color: var(--callout-info-bg);
  border-left-color: var(--accent);
}

.callout-warning {
  background-color: var(--callout-warning-bg);
  border-left-color: #e6a23c;
}

.callout-danger {
  background-color: var(--callout-danger-bg);
  border-left-color: #d9534f;
}

.callout-title {
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 404 Page */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}

.not-found-container {
  max-width: 28rem;
}

.not-found h1 {
  font-size: 6rem;
  margin: 0;
  color: var(--accent);
  opacity: 0.7;
}

.not-found h2 {
  font-size: 2rem;
  margin: 0 0 1.5rem;
  border: none;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--accent);
  color: white;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.button:hover {
  background-color: var(--accent-hover);
  text-decoration: none;
  color: white;
}

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

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

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

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

  .sidebar-toggle {
    display: block;
  }

  .content-header {
    padding: 1rem;
  }

  .content {
    padding: 1.5rem 1rem;
  }
}

/* Photo Gallery Styles */
.photo-gallery {
  margin: 2rem 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 1;
  cursor: pointer;
  transition: transform var(--transition-normal);
  background-color: var(--code-bg);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 1rem;
  color: white;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.gallery-item:hover .overlay {
  opacity: 1;
}

.gallery-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--accent-light);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Lightbox styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(32, 32, 32, 0.9);
  display: none;
  z-index: 1000;
  overflow: hidden;
}

.lightbox.active {
  display: flex;
  flex-direction: column;
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  color: white;
}

.lightbox-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  color: white;
}

.lightbox-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: background-color var(--transition-fast);
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
}

.lightbox-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  cursor: pointer;
}

.lightbox-nav:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

.lightbox-prev {
  left: 0;
}

.lightbox-next {
  right: 0;
}

.lightbox-footer {
  padding: 1rem;
  text-align: center;
  color: #ccc;
  font-size: 0.875rem;
}

.lightbox-counter {
  margin-left: 0.5rem;
  color: #999;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .lightbox-img {
    max-width: 95%;
    max-height: 70vh;
  }

  .lightbox-nav {
    width: 20%;
  }
}
