/**
 * Couchbase Query Analyzer - Shared Styles
 * Version: 4.0.0-dev
 * 
 * This file contains shared CSS used across all public pages:
 * - index.html
 * - analysis_hub.html
 * - getting_started.html
 * - sql_queries.html
 * 
 * Page-specific overrides can be added in <style> blocks after this file.
 */

/* ==========================================================================
   Base Layout & Typography
   ========================================================================== */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f7fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    text-align: center;
    padding: 20px 20px;
    background: linear-gradient(135deg, #007acc 0%, #00b4d8 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Compact header variant for docs-style pages */
header.header-compact {
    padding: 5px 20px;
}

h1 {
    font-size: 2.5em;
    margin: 0;
    letter-spacing: 0.2px;
}

h2 {
    font-size: 1.8em;
    color: #007acc;
    margin-top: 40px;
    position: relative;
}

h2::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    background: #00b4d8;
    border-radius: 2px;
    margin-top: 8px;
}

h3 {
    font-size: 1.3em;
    color: #333;
    margin-top: 24px;
}

code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

pre {
    background: #1e1e1e;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* ==========================================================================
   Cards / Steps Pattern
   ========================================================================== */

.steps,
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.steps.stacked,
.features.stacked {
    grid-template-columns: 1fr;
}

.step,
.feature {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eaeef2;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.step:hover,
.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.step strong,
.feature strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #333;
}

/* Step card variant (for getting_started.html) */
.step-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #eaeef2;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    margin: 20px 0;
}

.step-card strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #333;
}

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

.step a.btn,
a.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #48bb78;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
    box-shadow: 0 2px 6px rgba(72,187,120,0.25);
    transition: background 0.2s ease, transform 0.2s ease;
}

.step a.btn:hover,
a.btn:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.step a.btn.secondary,
a.btn.secondary {
    background: #007acc;
}

.step a.btn.secondary:hover,
a.btn.secondary:hover {
    background: #005f99;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.15em;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,122,204,0.3);
}

.btn-large:hover {
    box-shadow: 0 6px 18px rgba(0,122,204,0.4);
}

/* ==========================================================================
   Icon Rows
   ========================================================================== */

.icon-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-row .icon-wrapper {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-row img {
    width: auto;
    height: 40px;
    max-width: 50px;
}

.icon-row a {
    color: #007acc;
    text-decoration: none;
    font-weight: 500;
}

.icon-row a:hover {
    text-decoration: underline;
}

/* Inline icons (side by side) */
.icons-inline {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 12px;
}

.icons-inline .icon-wrapper {
    width: 50px;
    height: 50px;
}

.icons-inline img {
    height: 44px;
    width: auto;
    max-width: 60px;
}

/* ==========================================================================
   SQL Query Box + Copy Button
   ========================================================================== */

.sql-query-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sql-query-box pre {
    background: #ffffff;
    color: #333;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.sql-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}

.sql-copy-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

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

.tabs-container {
    margin-top: 15px;
}

.tab-buttons {
    display: flex;
    gap: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: #e2e8f0;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #4a5568;
    transition: background 0.2s ease, color 0.2s ease;
}

.tab-btn:first-child {
    border-radius: 8px 0 0 0;
}

.tab-btn:last-child {
    border-radius: 0 8px 0 0;
}

.tab-btn.active {
    background: #007acc;
    color: white;
}

.tab-content {
    display: none;
    background: white;
    border: 1px solid #eaeef2;
    border-radius: 0 10px 10px 10px;
    padding: 25px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

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

/* Dashed border variant for index.html tabs */
.tab-content.tab-dashed {
    border: 2px dashed #007acc;
}

/* ==========================================================================
   Accordion
   ========================================================================== */

.accordion {
    background: white;
    border-radius: 10px;
    border: 1px solid #eaeef2;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    margin: 20px 0;
}

.accordion-header {
    padding: 15px;
    cursor: pointer;
    background: #f0f8ff;
    font-weight: bold;
    border-bottom: 1px solid #e6eef5;
}

.accordion-content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-content.open {
    max-height: 500px;
    padding: 15px;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.version-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff8c00 0%, #ffb347 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    margin-right: 6px;
    box-shadow: 0 2px 8px rgba(255,140,0,0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 2px 8px rgba(255,140,0,0.4); }
    50% { box-shadow: 0 2px 16px rgba(255,140,0,0.7); }
}

.badge-new {
    display: inline-block;
    background: #e53e3e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
    vertical-align: middle;
}

.badge-pro {
    display: inline-block;
    padding: 2px 8px;
    background: #f59e0b;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.badge-warning {
    display: inline-block;
    padding: 2px 8px;
    background: #dc2626;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.badge-beta {
    display: inline-block;
    padding: 2px 8px;
    background: #6366f1;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* ==========================================================================
   Floating GitHub Icon
   ========================================================================== */

.floating-github {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 999;
    text-align: center;
}

.floating-github img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

.floating-github .copyright {
    margin-top: 6px;
    font-size: 12px;
    color: #777;
}

/* ==========================================================================
   Version Badge (Bottom Left)
   ========================================================================== */

.version-info {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(255,140,0,0.15);
    color: #b35900;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-family: monospace;
    z-index: 999;
    border: 1px solid rgba(255,140,0,0.3);
}

/* Subtle version badge variant */
.version-info.subtle {
    background: rgba(0,0,0,0.1);
    color: #333;
    border: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.version-info.subtle:hover {
    opacity: 1;
    background: rgba(0,0,0,0.2);
}

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

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid #eaeef2;
    margin-top: 30px;
}

footer a {
    color: #007acc;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

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

.comparison-table,
.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.comparison-table th,
.ai-table th {
    background: linear-gradient(135deg, #007acc 0%, #00b4d8 100%);
    color: white;
    padding: 15px;
    font-weight: 600;
    text-align: left;
}

.ai-table th {
    text-align: center;
}

.comparison-table th:first-child {
    background: #f0f8ff;
    color: #333;
}

.comparison-table td,
.ai-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.comparison-table tr:last-child td,
.ai-table tr:last-child td {
    border-bottom: none;
}

.comparison-table a,
.ai-table a {
    color: #007acc;
    text-decoration: none;
}

.comparison-table a:hover,
.ai-table a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Note / Info Boxes
   ========================================================================== */

.note-box {
    background: #e6f4ff;
    border-left: 4px solid #007acc;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.note-box strong {
    color: #007acc;
}

.success-box {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
}

.success-box h3 {
    color: #155724;
    margin: 0 0 10px 0;
}

.success-box p {
    color: #155724;
    margin: 0;
}

/* ==========================================================================
   Back Link
   ========================================================================== */

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #007acc;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Back to top link */
.back-to-top {
    display: block;
    text-align: right;
    margin-top: 8px;
}

.back-to-top a {
    color: #007acc;
    text-decoration: none;
    font-weight: 600;
}

.back-to-top a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Steps List (Numbered)
   ========================================================================== */

ol.steps-list {
    padding-left: 20px;
}

ol.steps-list li {
    margin: 10px 0;
}

ol.steps-list li strong {
    display: inline;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(0,122,204,0.35);
    outline-offset: 2px;
    border-radius: 6px;
}

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

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .comparison-table,
    .ai-table {
        font-size: 0.9em;
    }
}

/* ==========================================================================
   Icon Hover Zoom Effect
   ========================================================================== */

.icon-zoom {
    transition: transform 0.2s ease;
    cursor: pointer;
}

.icon-zoom:hover {
    transform: scale(2.5);
    z-index: 100;
    position: relative;
}

/* Screenshot preview thumbnail */
.screenshot-preview {
    cursor: zoom-in;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: box-shadow 0.2s ease;
}

.screenshot-preview:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    border-radius: 8px;
}
