/* ============================================
   TicketPayGo Documentation Styles
   Mobile-first, clean, professional
   ============================================ */

/* CSS Variables */
:root {
    --color-primary: #0a4974;
    --color-primary-dark: #083a5c;
    --color-secondary: #42963b;
    --color-secondary-dark: #357a30;
    --color-text: #1a1a1a;
    --color-text-light: #4b5563;
    --color-text-muted: #6b7280;
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-bg-sidebar: #f1f5f9;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --shadow-sm: 0 1px 2px 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);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 260px;
    --header-height: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.sidebar-open {
    overflow: hidden;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    padding: 12px 24px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    z-index: 1000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 16px;
}

/* Header */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.logo img {
    height: 32px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.version-badge {
    display: none;
    padding: 4px 10px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

/* Language Switcher (matches index.html style) */
.docs-lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--color-bg-alt);
    padding: 2px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.docs-lang-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-lang-btn:hover {
    background: rgba(10, 73, 116, 0.05);
    color: var(--color-text-light);
}

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

/* Back Link */
.back-link {
    display: none;
    font-size: 13px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Layout */
.docs-layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 90;
}

.docs-sidebar.open {
    transform: translateX(0);
}

.sidebar-nav {
    padding: 24px 16px;
}

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

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: block;
    padding: 10px 16px;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: background 0.15s, color 0.15s;
}

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

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

/* Main Content */
.docs-content {
    flex: 1;
    padding: 32px 16px 64px;
    max-width: 100%;
}

/* Sections */
.docs-section {
    margin-bottom: 64px;
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.docs-section:last-child {
    margin-bottom: 32px;
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--color-text);
}

h2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text);
}

h3 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--color-text);
}

h4 {
    font-size: 15px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--color-text);
}

p {
    margin-bottom: 16px;
    color: var(--color-text-light);
}

.intro-text {
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 32px;
}

/* Lists */
ul, ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
    color: var(--color-text-light);
}

li strong {
    color: var(--color-text);
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Code */
code {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 2px 6px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
}

pre {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--color-text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-secondary-dark), var(--color-primary-dark));
}

.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border-light);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

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

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
}

/* Feature Highlights */
.feature-highlights {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.highlight-item {
    padding: 16px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.highlight-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--color-text);
}

.highlight-item span {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Steps List */
.steps-list {
    margin: 24px 0;
}

.step {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.step:last-child {
    border-bottom: none;
}

.step-number {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    border-radius: 50%;
}

.step-content h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

.step-content p {
    margin-bottom: 0;
    font-size: 14px;
}

/* Callouts */
.callout {
    padding: 16px 20px;
    margin: 24px 0;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.callout strong {
    display: block;
    margin-bottom: 4px;
}

.callout-tip {
    background: #ecfdf5;
    border-color: var(--color-success);
}

.callout-tip strong {
    color: #047857;
}

.callout-note {
    background: #fef3c7;
    border-color: var(--color-warning);
}

.callout-note strong {
    color: #b45309;
}

.callout-warning {
    background: #fef2f2;
    border-color: var(--color-error);
}

.callout-warning strong {
    color: #b91c1c;
}

/* Troubleshooting */
.troubleshooting-list {
    margin-top: 24px;
}

.troubleshooting-item {
    padding: 20px;
    margin-bottom: 16px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.troubleshooting-item h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--color-text);
}

.troubleshooting-item p {
    margin-bottom: 8px;
    font-size: 14px;
}

.troubleshooting-item p:last-child {
    margin-bottom: 0;
}

/* FAQ */
.faq-list {
    margin-top: 24px;
}

.faq-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--color-text);
}

.faq-item p {
    margin-bottom: 0;
    font-size: 14px;
}

/* Contact Options */
.contact-options {
    display: grid;
    gap: 16px;
    margin: 24px 0;
}

.contact-option {
    padding: 20px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.contact-option h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

.contact-option p {
    margin-bottom: 0;
    font-size: 14px;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 50;
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    text-decoration: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.docs-footer {
    padding: 32px 16px;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.footer-inner p {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    font-size: 14px;
    color: var(--color-text-light);
}

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

/* ============================================
   Footer (matches index.html tpg-footer)
   ============================================ */
.tpg-footer {
    padding: 2rem 0;
    background: #111827;
    color: #9ca3af;
    text-align: center;
}

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

.tpg-footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.tpg-footer-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.tpg-footer p {
    margin: 0;
    font-size: 0.875rem;
}

.tpg-footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.tpg-footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.tpg-footer-links a:hover {
    color: #ffffff;
}

.tpg-footer-divider {
    color: #4b5563;
}

.tpg-footer-product {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.tpg-footer-copyright {
    color: #6b7280;
    font-size: 0.75rem;
}

/* ============================================
   Shortcode Table
   ============================================ */
.shortcode-table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.shortcode-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.shortcode-table th,
.shortcode-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.shortcode-table th {
    background: var(--color-bg-alt);
    font-weight: 600;
    color: var(--color-text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcode-table td {
    color: var(--color-text-light);
}

.shortcode-table tr:last-child td {
    border-bottom: none;
}

.shortcode-table code {
    font-size: 12px;
}

/* Code Examples */
.code-example {
    margin: 16px 0;
}

.code-example p {
    margin-bottom: 8px;
}

/* ============================================
   Tablet Styles (768px+)
   ============================================ */
@media (min-width: 768px) {
    .header-inner {
        padding: 0 24px;
    }

    .version-badge {
        display: block;
    }

    .back-link {
        display: block;
    }

    .docs-content {
        padding: 40px 32px 80px;
    }

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 24px;
    }

    .intro-text {
        font-size: 19px;
    }

    .feature-highlights {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Desktop Styles (1024px+)
   ============================================ */
@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }

    .docs-sidebar {
        position: sticky;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        width: var(--sidebar-width);
        transform: translateX(0);
        flex-shrink: 0;
    }

    .docs-content {
        padding: 48px 64px 96px;
        max-width: calc(100% - var(--sidebar-width));
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 26px;
    }

    h3 {
        font-size: 18px;
    }

    .intro-text {
        font-size: 20px;
        max-width: 700px;
    }

    .feature-highlights {
        grid-template-columns: repeat(4, 1fr);
    }

    .troubleshooting-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .troubleshooting-item {
        margin-bottom: 0;
    }

    .contact-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .footer-inner p {
        margin-bottom: 0;
    }
}

/* ============================================
   Large Desktop Styles (1280px+)
   ============================================ */
@media (min-width: 1280px) {
    .docs-content {
        padding: 56px 80px 120px;
        max-width: 900px;
    }

    .docs-section {
        margin-bottom: 80px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .docs-header,
    .docs-sidebar,
    .back-to-top,
    .cta-buttons,
    .mobile-menu-toggle {
        display: none !important;
    }

    .docs-layout {
        display: block;
        margin-top: 0;
    }

    .docs-content {
        max-width: 100%;
        padding: 0;
    }

    .docs-section {
        page-break-inside: avoid;
    }

    h2 {
        page-break-after: avoid;
    }

    a {
        color: var(--color-text);
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: var(--color-text-muted);
    }
}
