/* ===========================================
   SailOps Documentation Styles
   =========================================== */

:root {
  --primary-color: #2563eb;
  --secondary-color: #0f172a;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  --border-color: #e2e8f0;
  --border-radius: 12px;
  --border-radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

  --navy-blue: #0a2540;
  --ocean-blue: #2563eb;
  --sky-blue: #3b82f6;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===========================================
   Header
   =========================================== */

.docs-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 40px;
  display: block;
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 0;
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary-color);
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  bottom: -1rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
}

/* ===========================================
   Hero Section
   =========================================== */

.hero-section {
  background: linear-gradient(
    135deg,
    var(--navy-blue) 0%,
    var(--ocean-blue) 100%
  );
  color: white;
  padding: 4rem 0;
  text-align: center;
}

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

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ===========================================
   Main Content
   =========================================== */

.docs-main {
  padding: 4rem 0;
}

/* ===========================================
   Documentation Grid
   =========================================== */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.doc-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.doc-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.doc-card.primary {
  border-left: 4px solid var(--primary-color);
}

.doc-icon {
  width: 64px;
  height: 64px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.doc-card.featured .doc-icon {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.doc-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: inherit;
}

.doc-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.doc-card.featured .doc-content p {
  color: rgba(255, 255, 255, 0.9);
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: gap 0.2s;
}

.doc-card.featured .doc-link {
  color: white;
}

.doc-link:hover {
  gap: 0.75rem;
}

.doc-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--warning-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-badge.available {
  background: var(--success-color);
}

.doc-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

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

.doc-meta-item svg {
  stroke: var(--text-muted);
}

/* ===========================================
   Quick Links Section
   =========================================== */

.quick-links-section {
  margin-bottom: 4rem;
}

.quick-links-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--navy-blue);
}

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

.quick-link-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: block;
}

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

.quick-link-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

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

.quick-link-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

/* ===========================================
   Support Section
   =========================================== */

.support-section {
  background: linear-gradient(
    135deg,
    var(--navy-blue) 0%,
    var(--ocean-blue) 100%
  );
  color: white;
  border-radius: var(--border-radius-lg);
  padding: 3rem;
  text-align: center;
}

.support-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.support-content p {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.support-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

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

/* ===========================================
   Footer
   =========================================== */

.docs-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-content p {
  color: var(--text-secondary);
  margin: 0;
}

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

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

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

/* ===========================================
   Manual Page Styles
   =========================================== */

.manual-header {
  background: linear-gradient(
    135deg,
    var(--navy-blue) 0%,
    var(--ocean-blue) 100%
  );
  color: white;
  padding: 2rem 0;
}

.manual-header .breadcrumb {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  opacity: 0.8;
  font-size: 0.875rem;
}

.manual-header .breadcrumb li::after {
  content: "/";
  margin-left: 0.5rem;
}

.manual-header .breadcrumb li:last-child::after {
  display: none;
}

.manual-header .breadcrumb a {
  color: white;
  text-decoration: none;
}

.manual-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.manual-header .subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
}

.manual-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  padding: 3rem 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* Sidebar Navigation */
.sidebar {
  position: sticky;
  top: 6rem;
  height: fit-content;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

.sidebar-nav {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.sidebar-nav h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

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

.sidebar-nav li {
  margin-bottom: 0.5rem;
}

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

.sidebar-nav a:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

.sidebar-nav a.active {
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

/* Manual Content */
.manual-content {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.manual-content h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy-blue);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.manual-content h2:first-child {
  margin-top: 0;
}

.manual-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.manual-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.manual-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.manual-content ul,
.manual-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.manual-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.manual-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.manual-content code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: "Monaco", "Courier New", monospace;
  color: var(--danger-color);
}

.manual-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.manual-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* Screenshot Display */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.screenshot {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.screenshot img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

.screenshot-caption {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Info Boxes */
.info-box {
  background: var(--bg-secondary);
  border-left: 4px solid var(--info-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.info-box.success {
  border-left-color: var(--success-color);
}

.info-box.warning {
  border-left-color: var(--warning-color);
}

.info-box.danger {
  border-left-color: var(--danger-color);
}

.info-box h4 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tables */
.manual-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.manual-content th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  padding: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.manual-content td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.manual-content tr:last-child td {
  border-bottom: none;
}

.manual-content tr:hover {
  background: var(--bg-secondary);
}

/* Navigation Buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: background 0.2s;
}

.nav-button:hover {
  background: var(--navy-blue);
}

.nav-button.prev svg {
  transform: rotate(180deg);
}

/* Table of Contents */
.toc {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.toc h3 {
  margin-top: 0 !important;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.toc ul {
  list-style: none;
  padding-left: 0;
}

.toc li {
  margin-bottom: 0.5rem;
}

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

.toc a:hover {
  color: var(--navy-blue);
  text-decoration: underline;
}

/* ===========================================
   Responsive Design
   =========================================== */

@media (max-width: 1024px) {
  .manual-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: relative;
    top: auto;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

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

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

  .docs-grid {
    grid-template-columns: 1fr;
  }

  .doc-card.featured {
    grid-column: auto;
  }

  .manual-content {
    padding: 1.5rem;
  }

  .manual-content h2 {
    font-size: 1.5rem;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .support-section {
    padding: 2rem 1.5rem;
  }

  .nav-buttons {
    flex-direction: column;
    gap: 1rem;
  }
}

/* ===========================================
   Phone Frame Display
   =========================================== */

.phone-mockup {
  max-width: 300px;
  margin: 2rem auto;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 2rem;
  box-shadow: var(--shadow-xl);
}

.phone-mockup img {
  width: 100%;
  border-radius: 1.5rem;
  display: block;
}

/* Flow Diagram */
.flow-diagram {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 2;
  color: var(--text-primary);
  overflow-x: auto;
}

/* Print Styles */
@media print {
  .docs-header,
  .docs-footer,
  .sidebar,
  .nav-buttons,
  .support-section {
    display: none;
  }

  .manual-layout {
    grid-template-columns: 1fr;
  }

  .manual-content {
    box-shadow: none;
    border: none;
  }
}
