/* ===========================
   NxVET Partner API Documentation
   Professional ReadMe-inspired styles
   =========================== */

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-gray: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --code-bg: #1F2937;
    --code-text: #F9FAFB;
}

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

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

/* ===========================
   Navigation
   =========================== */

.navbar {
    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);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* ===========================
   Container & Layout
   =========================== */

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

.section {
    padding: 4rem 0;
}

.section-gray {
    background: var(--bg-gray);
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.section-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

/* ===========================
   Buttons
   =========================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===========================
   Integration Cards
   =========================== */

.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.integration-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.integration-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.integration-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.feature-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.feature-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

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

.card-link:hover {
    gap: 0.5rem;
}

/* ===========================
   Steps Grid
   =========================== */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 3rem;
    height: 3rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--text-secondary);
}

/* ===========================
   Features Grid
   =========================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    padding: 1.5rem;
}

.feature h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-secondary);
}

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

.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section p {
    opacity: 0.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    opacity: 0.7;
    font-size: 0.875rem;
}

/* ===========================
   Documentation Layout
   =========================== */

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

.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-nav h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

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

.sidebar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: block;
    padding: 0.25rem 0;
}

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

.docs-content {
    max-width: 900px;
}

.docs-header {
    margin-bottom: 3rem;
}

.docs-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.docs-header .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.docs-header .last-updated {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.doc-section h2 {
    font-size: 1.875rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.doc-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.doc-section h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.doc-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

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

.doc-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.doc-section code {
    background: var(--bg-gray);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    color: var(--primary-color);
}

.doc-section pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.doc-section pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* ===========================
   Alerts
   =========================== */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.alert-info {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #1E40AF;
}

.alert-warning {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
}

.alert strong {
    font-weight: 600;
}

/* ===========================
   Tables
   =========================== */

.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.field-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.field-table thead {
    background: var(--bg-gray);
}

.field-table th {
    text-align: left;
    padding: 0.75rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.field-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.field-table code {
    white-space: nowrap;
}

/* ===========================
   Device Cards
   =========================== */

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.device-card {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.device-card h3 {
    margin-bottom: 1rem;
}

.device-card ul {
    margin-left: 1.5rem;
}

/* ===========================
   Code Tabs
   =========================== */

.code-tabs {
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    margin: 0;
    border-radius: 0;
}

/* ===========================
   Checklist
   =========================== */

.checklist {
    margin: 2rem 0;
}

.checklist label {
    display: block;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-gray);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s;
}

.checklist label:hover {
    background: var(--border-color);
}

.checklist input[type="checkbox"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

/* ===========================
   API Docs Container (Stoplight)
   =========================== */

.api-docs-container {
    min-height: calc(100vh - 200px);
}

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

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

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

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

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

    .integration-grid,
    .device-grid {
        grid-template-columns: 1fr;
    }

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

    .sidebar {
        position: static;
    }

    .docs-header h1 {
        font-size: 1.875rem;
    }
}

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

    .hero {
        padding: 3rem 0;
    }

    .section {
        padding: 2rem 0;
    }

    .tab-buttons {
        overflow-x: auto;
    }
}
