/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --sidebar-bg: #1e293b;
    --content-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --code-bg: #f8fafc;
    --code-border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #f8fafc;
}

/* Container Layout */
.docs-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.version {
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
}

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

.nav-section ul li {
    margin: 0;
}

.nav-section ul li a {
    display: block;
    padding: 0.625rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-section ul li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-section ul li a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    max-width: 900px;
}

/* Documentation Sections */
.doc-section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
}

.doc-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.doc-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.doc-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.doc-section ol {
    margin-left: 1.5rem;
    color: var(--text-secondary);
}

.doc-section ol li {
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 1rem;
}

.badge-get {
    background: #dbeafe;
    color: #1e40af;
}

.badge-post {
    background: #d1fae5;
    color: #065f46;
}

.badge-put {
    background: #fef3c7;
    color: #92400e;
}

.badge-delete {
    background: #fee2e2;
    color: #991b1b;
}

/* Code Blocks */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

pre {
    background: var(--dark-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

pre code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: #e2e8f0;
    line-height: 1.7;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    color: var(--primary-color);
}

pre code {
    background: transparent;
    padding: 0;
}

/* Tables */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.params-table thead {
    background: var(--code-bg);
}

.params-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 2px solid var(--border-color);
}

.params-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.params-table tbody tr:hover {
    background: var(--code-bg);
}

.params-table code {
    background: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

/* Info and Alert Boxes */
.info-box,
.alert-box {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-box {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.info-box strong,
.alert-box strong {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.info-box code,
.alert-box code {
    background: rgba(255, 255, 255, 0.5);
    color: inherit;
}

.token {
    user-select: all;
    cursor: pointer;
}

/* Steps List */
.steps-list {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.steps-list li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.steps-list code {
    background: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

/* Responsive Design */

/* Tablet and below (1024px and down) */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 2000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

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

    .main-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
        width: 100%;
    }

    /* Overlay when sidebar is open */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
    }
}

/* Mobile devices (768px and down) */
@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 1rem;
    }

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

    .doc-section h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

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

    .doc-section p {
        font-size: 0.95rem;
    }

    /* Make tables responsive - horizontal scroll */
    .params-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.85rem;
    }

    .params-table th,
    .params-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* Code blocks responsive */
    pre {
        padding: 1rem;
        font-size: 0.8rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .code-block {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .code-block code {
        font-size: 0.8rem;
    }

    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    /* Info and alert boxes */
    .info-box,
    .alert-box {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    .info-box ol,
    .info-box ul {
        font-size: 0.9rem;
    }

    /* Steps list */
    .steps-list {
        padding-left: 1.5rem;
        font-size: 0.9rem;
    }

    .steps-list li {
        margin-bottom: 0.5rem;
    }

    /* Sidebar adjustments for mobile */
    .sidebar {
        width: 280px;
    }

    .sidebar-header h1 {
        font-size: 1.25rem;
    }

    .nav-section h3 {
        font-size: 0.7rem;
        padding: 0.5rem 1rem;
    }

    .nav-section ul li a {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}

/* Small mobile devices (640px and down) */
@media (max-width: 640px) {
    .main-content {
        padding: 1rem 0.75rem;
    }

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

    .doc-section h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
        word-wrap: break-word;
    }

    .doc-section h3 {
        font-size: 1.125rem;
        margin-top: 1.25rem;
        word-wrap: break-word;
    }

    .doc-section p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* Full width tables on small screens */
    .params-table {
        font-size: 0.75rem;
    }

    .params-table th,
    .params-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }

    /* Reduce code block padding */
    pre {
        padding: 0.75rem;
        font-size: 0.75rem;
        border-radius: 0.375rem;
    }

    .code-block {
        padding: 0.75rem;
    }

    .code-block code {
        font-size: 0.75rem;
    }

    /* Smaller badges */
    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    /* Info boxes adjustments */
    .info-box,
    .alert-box {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }

    .info-box strong,
    .alert-box strong {
        font-size: 0.9rem;
    }

    .info-box ol,
    .info-box ul,
    .alert-box ul {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* Steps list */
    .steps-list {
        padding-left: 1.25rem;
        font-size: 0.85rem;
    }

    /* Sidebar width adjustment */
    .sidebar {
        width: 260px;
    }

    .sidebar-header {
        padding: 1.5rem 1rem;
    }

    .sidebar-header h1 {
        font-size: 1.125rem;
    }

    .version {
        font-size: 0.8rem;
    }

    /* Back to top button */
    .back-to-top {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 1.25rem !important;
        bottom: 1rem !important;
        right: 1rem !important;
    }

    /* Copy button on code blocks */
    .copy-button {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    /* Footer responsive */
    .docs-footer {
        margin-top: 4rem;
        padding: 2rem 0 1.5rem;
    }

    .footer-section h4 {
        font-size: 1.125rem;
    }

    .footer-section p {
        font-size: 0.875rem;
    }

    .contact-link {
        font-size: 0.875rem;
        padding: 0.75rem 1.25rem;
        min-width: 240px;
    }

    .contact-link svg {
        width: 18px;
        height: 18px;
    }

    .powered-by {
        font-size: 0.9rem;
    }

    .copyright {
        font-size: 0.8rem;
    }
}

/* Extra small devices (480px and down) */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem 0.5rem;
    }

    .doc-section h2 {
        font-size: 1.375rem;
    }

    .doc-section h3 {
        font-size: 1rem;
    }

    .sidebar {
        width: 240px;
    }

    .params-table {
        font-size: 0.7rem;
    }

    .params-table th,
    .params-table td {
        padding: 0.4rem 0.3rem;
    }

    pre {
        font-size: 0.7rem;
        padding: 0.625rem;
    }

    .code-block code {
        font-size: 0.7rem;
    }
}

/* Landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .nav-section {
        margin-bottom: 1rem;
    }

    .nav-section h3 {
        padding: 0.375rem 1rem;
    }

    .nav-section ul li a {
        padding: 0.375rem 1rem;
    }
}

/* Large desktop screens (1440px and up) */
@media (min-width: 1440px) {
    .main-content {
        max-width: 1100px;
    }

    .doc-section h2 {
        font-size: 2.25rem;
    }

    .doc-section h3 {
        font-size: 1.5rem;
    }
}

/* Print styles */
@media print {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
    }

    .mobile-menu-button,
    .back-to-top {
        display: none !important;
    }

    .code-block,
    pre {
        page-break-inside: avoid;
    }

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

/* Prism.js Theme Overrides */
.language-json .token.property {
    color: #e2e8f0;
}

.language-json .token.string {
    color: #10b981;
}

.language-json .token.number {
    color: #f59e0b;
}

.language-json .token.boolean {
    color: #3b82f6;
}

.language-bash .token.function {
    color: #10b981;
}

.language-bash .token.string {
    color: #f59e0b;
}

/* Footer Styles */
.docs-footer {
    margin-top: 6rem;
    padding: 4rem 2rem 2.5rem;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.docs-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    z-index: 0;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.footer-section h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-links {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: white;
    border: 2px solid transparent;
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    position: relative;
    overflow: hidden;
}

.contact-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.contact-link:hover::before {
    left: 100%;
}

.contact-link:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.contact-link svg {
    flex-shrink: 0;
}

.contact-link.whatsapp {
    background: #25d366;
    color: white;
}

.contact-link.whatsapp:hover {
    background: #20ba5a;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

.contact-link.whatsapp svg {
    color: white;
}

.contact-link.email {
    background: white;
    color: #6366f1;
}

.contact-link.email:hover {
    background: #6366f1;
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.contact-link.email svg {
    color: #6366f1;
    transition: all 0.3s ease;
}

.contact-link.email:hover svg {
    stroke: white;
    color: white;
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 3rem auto;
    max-width: 400px;
}

.footer-bottom {
    text-align: center;
}

.powered-by {
    font-size: 1.125rem;
    color: white;
    margin-bottom: 0.75rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.smartwats-link {
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 2px;
}

.smartwats-link:hover {
    border-bottom-color: white;
    letter-spacing: 0.5px;
}

.copyright {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Focus Styles */
a:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-section {
    animation: fadeIn 0.5s ease-out;
}