@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Deep Ocean Theme Colors */
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-light: #06b6d4;

  --accent: #67e8f9;
  --accent-dark: #22d3ee;

  --background: #ffffff;
  --surface: #f8fafc;
  --surface-elevated: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --navy-deep: #0f172a;
  --navy-medium: #1e293b;
  --navy-light: #334155;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.dark {
  --background: #0f172a;
  --surface: #1e293b;
  --surface-elevated: #334155;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  --border: #334155;
  --border-light: #1e293b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background-color: var(--navy-deep);
  border-bottom: 1px solid var(--navy-medium);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-link:hover {
  color: white;
  background-color: var(--navy-medium);
}

.nav-link.primary {
  background-color: var(--primary);
  color: white;
}

.nav-link.primary:hover {
  background-color: var(--primary-dark);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
}

/* Header Search */
.header-search-container {
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
  position: relative;
}

.header-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-input {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
  transition: all 0.2s ease;
  font-family: inherit;
}

.header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.header-search-input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

.header-search-icon {
  position: absolute;
  left: 0.875rem;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.header-search-clear {
  position: absolute;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-search-clear:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
}

.header-search-clear svg {
  width: 14px;
  height: 14px;
}

.header-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.header-search-results[style*="display: block"] {
  opacity: 1;
  transform: translateY(0);
}

.header-search-results-content {
  padding: 0.5rem;
}

.header-search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.header-search-result-item:hover {
  background-color: var(--surface);
}

.header-search-result-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.header-search-result-icon svg {
  width: 20px;
  height: 20px;
}

.header-search-result-content {
  flex: 1;
  min-width: 0;
}

.header-search-result-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.header-search-result-description {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.header-search-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.header-search-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.header-search-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.header-search-empty-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.header-search-empty-text {
  font-size: 0.8125rem;
}

.header-search-loading {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-medium) 100%);
  padding: 4rem 1.5rem;
  text-align: center;
  color: white;
  flex-shrink: 0;
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.125rem;
  color: var(--accent);
  margin-bottom: 2rem;
}

/* Search Bar */
.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-bar {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  background-color: white;
  transition: all 0.2s;
}

.search-bar:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Sticky Search */
.sticky-search {
  position: sticky;
  top: 73px;
  z-index: 40;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
}

.sticky-search .search-container {
  max-width: 100%;
}

.sticky-search .search-bar {
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
}

.sticky-search .search-icon {
  left: 0.75rem;
}

/* Main Container */
main {
  flex: 1 0 auto;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
}

.container-with-sidebar {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* Categories Grid */
.categories-section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

.category-card {
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.category-card:hover .category-icon {
  background-color: var(--primary);
  color: white;
}

.category-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.category-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Featured Topics */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

.topic-card {
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
}

.topic-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.topic-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.topic-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs span {
  color: var(--text-muted);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 150px;
  height: fit-content;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.sidebar h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-category {
  margin-bottom: 1rem;
}

.sidebar-category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 0.2s;
  text-align: left;
}

.sidebar-category-btn:hover {
  background-color: var(--surface);
}

.sidebar-category-btn.active {
  background-color: var(--primary);
  color: white;
}

.chevron {
  transition: transform 0.2s;
}

.chevron.open {
  transform: rotate(90deg);
}

.sidebar-subcategories {
  list-style: none;
  margin-top: 0.5rem;
  margin-left: 1rem;
  display: none;
}

.sidebar-subcategories.open {
  display: block;
}

.sidebar-subcategories a {
  display: block;
  padding: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.sidebar-subcategories a:hover {
  background-color: var(--surface);
  color: var(--primary);
}

/* Content Area */
.content-area {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.subcategory-section {
  margin-bottom: 3rem;
}

.subcategory-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.topics-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Article Content */
.article {
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 768px) {
  .article {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .article {
    padding: 1rem;
    border-radius: var(--radius);
  }
}

.article h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  word-wrap: break-word;
}

@media (max-width: 768px) {
  .article h1 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .article h1 {
    font-size: 1.5rem;
  }
}

.article-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.article-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}

.article-content pre {
  overflow-x: auto;
  max-width: 100%;
}

.article-content table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

/* Related Topics */
.related-section {
  margin-top: 3rem;
}

.related-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

/* Footer */
.footer {
  background-color: var(--navy-deep);
  color: var(--text-muted);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  text-align: center;
  flex-shrink: 0;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

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

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 1024px) {
  .header-search-container {
    max-width: 350px;
    margin: 0 1rem;
  }

  .container-with-sidebar {
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    padding: 1.5rem 1rem;
  }

  .container {
    padding: 2rem 1rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--navy-medium);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .header-search-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 1rem 1.5rem;
    background-color: var(--navy-deep);
    border-bottom: 1px solid var(--navy-medium);
    max-width: 100%;
  }

  .header-container {
    position: relative;
    flex-wrap: wrap;
  }

  .header-search-results {
    max-height: 300px;
  }

  .header-search-result-icon {
    width: 32px;
    height: 32px;
  }

  .header-search-result-icon svg {
    width: 18px;
    height: 18px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .container,
  .container-with-sidebar {
    padding: 1.5rem 1rem;
  }

  .container-with-sidebar {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 1.5rem;
  }

  .categories-grid,
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {

  .container,
  .container-with-sidebar {
    padding: 1rem 0.75rem;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }
}

/* Icons (using simple SVG) */
.icon {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.d-none {
  display: none;
}

/* Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}