/* ========================================
   PratikEsnaf API Dokümantasyonu CSS
   Stripe/Twilio Inspired Professional Design
   ======================================== */

:root {
    --api-primary: #635bff;
    --api-primary-light: #818cf8;
    --api-primary-bg: #f0f0ff;
    --api-success: #10b981;
    --api-warning: #f59e0b;
    --api-danger: #ef4444;
    --api-info: #0ea5e9;
    --api-sidebar-width: 260px;
    --api-topbar-height: 56px;
    --api-bg: #f8fafc;
    --api-card-bg: #ffffff;
    --api-border: #e2e8f0;
    --api-text: #1e293b;
    --api-text-muted: #64748b;
    --api-code-bg: #0f172a;
    --api-code-text: #e2e8f0;
    --api-shadow: 0 1px 3px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body.api-docs-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--api-bg);
    color: var(--api-text);
    margin: 0;
    padding: 0;
}

/* ==================== TOPBAR ==================== */
.api-topbar {
    height: var(--api-topbar-height);
    background: var(--api-code-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.api-topbar-logo img {
    height: 26px;
    filter: brightness(0) invert(1);
}

.api-topbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,.2);
}

.api-topbar-title {
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
}

.api-topbar-version {
    background: rgba(99, 91, 255, .3);
    color: var(--api-primary-light);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .75rem;
    font-weight: 600;
}

.api-topbar-link {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    transition: color .15s;
}

.api-topbar-link:hover {
    color: #fff;
}

.api-topbar-btn {
    background: var(--api-primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    transition: background .15s;
}

.api-topbar-btn:hover {
    background: #5046e4;
    color: #fff;
}

/* ==================== LAYOUT ==================== */
.api-layout {
    display: flex;
    min-height: calc(100vh - var(--api-topbar-height));
}

/* ==================== SIDEBAR ==================== */
.api-sidebar {
    width: var(--api-sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--api-border);
    position: sticky;
    top: var(--api-topbar-height);
    height: calc(100vh - var(--api-topbar-height));
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 1020;
}

.api-sidebar-section {
    padding: 16px 16px 8px;
}

.api-sidebar-section + .api-sidebar-section {
    border-top: 1px solid var(--api-border);
}

.api-sidebar-heading {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--api-text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    padding: 0 8px;
}

.api-sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--api-text);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 500;
    transition: all .15s;
    margin-bottom: 2px;
}

.api-sidebar-link:hover {
    background: var(--api-primary-bg);
    color: var(--api-primary);
}

.api-sidebar-link.active {
    background: var(--api-primary);
    color: #fff;
}

.api-sidebar-link.active i {
    color: #fff;
}

.api-sidebar-link i {
    font-size: .95rem;
    width: 18px;
    text-align: center;
    color: var(--api-text-muted);
}

.api-sidebar-count {
    margin-left: auto;
    font-size: .7rem;
    background: rgba(100,116,139,.1);
    color: var(--api-text-muted);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.api-sidebar-link.active .api-sidebar-count {
    background: rgba(255,255,255,.2);
    color: #fff;
}

/* ==================== MAIN ==================== */
.api-main {
    flex: 1;
    min-width: 0;
    padding: 32px 48px;
}

.api-content {
    max-width: 920px;
}

/* ==================== HERO ==================== */
.api-hero {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--api-border);
}

.api-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--api-primary), #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.api-hero p {
    font-size: 1.05rem;
    color: var(--api-text-muted);
    max-width: 600px;
    line-height: 1.6;
}

.api-hero-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.api-hero-badges .badge {
    font-size: .8rem;
    font-weight: 600;
    padding: 6px 12px;
}

/* ==================== SECTIONS ==================== */
.api-section {
    margin-bottom: 40px;
}

.api-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--api-text);
}

.api-section p {
    font-size: .925rem;
    line-height: 1.65;
    color: var(--api-text);
}

/* ==================== CODE BLOCKS ==================== */
.api-code-block {
    background: var(--api-code-bg);
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: var(--api-shadow);
}

.api-code-header {
    background: rgba(255,255,255,.05);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.api-code-header span {
    font-size: .78rem;
    color: rgba(255,255,255,.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.api-copy-btn {
    background: none;
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.5);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: .8rem;
    transition: all .15s;
}

.api-copy-btn:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.api-code-block pre {
    margin: 0;
    padding: 16px 20px;
    overflow-x: auto;
}

.api-code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--api-code-text);
}

.api-code-response {
    border-left: 3px solid var(--api-success);
}

/* ==================== INFO BOXES ==================== */
.api-info-box {
    background: var(--api-primary-bg);
    border: 1px solid rgba(99, 91, 255, .15);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 16px 0;
    font-size: .9rem;
}

.api-info-box.warning {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}

.api-info-box code {
    background: rgba(99, 91, 255, .1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .82rem;
}

.api-base-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--api-primary);
    background: none !important;
    font-weight: 600;
}

/* ==================== TABLES ==================== */
.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    margin: 12px 0;
}

.api-table thead th {
    background: #f1f5f9;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--api-text-muted);
    border-bottom: 2px solid var(--api-border);
}

.api-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--api-border);
    vertical-align: middle;
}

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

.api-table code {
    background: var(--api-primary-bg);
    color: var(--api-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 500;
}

.api-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: .78rem;
    color: var(--api-info);
    font-weight: 500;
}

/* ==================== STATUS BADGES ==================== */
.api-status-badge {
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ==================== ENDPOINT ==================== */
.api-endpoint {
    margin-bottom: 32px;
    padding: 28px;
    background: var(--api-card-bg);
    border: 1px solid var(--api-border);
    border-radius: 12px;
    box-shadow: var(--api-shadow);
}

.api-endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--api-border);
}

.api-method {
    font-family: 'JetBrains Mono', monospace;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
    flex-shrink: 0;
}

.api-method-get { background: #d1fae5; color: #065f46; }
.api-method-post { background: #dbeafe; color: #1e40af; }
.api-method-put { background: #fed7aa; color: #9a3412; }
.api-method-delete { background: #fee2e2; color: #991b1b; }

.api-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: .9rem;
    color: var(--api-text);
    background: none !important;
    font-weight: 500;
}

.api-endpoint h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.api-endpoint p {
    font-size: .9rem;
    color: var(--api-text-muted);
    margin-bottom: 16px;
}

.api-auth-badge {
    display: inline-flex;
    align-items: center;
    background: #fef3c7;
    color: #92400e;
    font-size: .78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.api-endpoint h5 {
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--api-text-muted);
    margin: 20px 0 8px;
}

.api-endpoint-divider {
    border: none;
    border-top: 2px solid var(--api-border);
    margin: 32px 0;
}

/* ==================== SECTION HEADER ==================== */
.api-section-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--api-border);
}

.api-section-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--api-primary), var(--api-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.api-section-icon i {
    font-size: 1.5rem;
    color: #fff;
}

.api-section-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

/* ==================== GROUP CARDS ==================== */
.api-group-card {
    display: block;
    background: var(--api-card-bg);
    border: 1px solid var(--api-border);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: var(--api-text);
    transition: all .2s;
    height: 100%;
    box-shadow: var(--api-shadow);
}

.api-group-card:hover {
    border-color: var(--api-primary-light);
    box-shadow: 0 8px 16px rgba(99, 91, 255, .1);
    transform: translateY(-2px);
    color: var(--api-text);
}

.api-group-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--api-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.api-group-icon i {
    font-size: 1.2rem;
    color: var(--api-primary);
}

.api-group-card h6 {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: .95rem;
}

.api-group-card p {
    font-size: .8rem;
    color: var(--api-text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
}

.api-group-count {
    font-size: .75rem;
    color: var(--api-primary);
    font-weight: 600;
}

/* ==================== CHANGELOG ==================== */
.api-changelog-entry {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--api-border);
}

.api-changelog-date {
    font-size: .8rem;
    font-weight: 600;
    color: var(--api-text-muted);
    white-space: nowrap;
    min-width: 120px;
}

.api-changelog-content {
    font-size: .875rem;
}

/* ==================== MOBILE ==================== */
.api-sidebar-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--api-code-bg);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    z-index: 1040;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991.98px) {
    .api-sidebar {
        position: fixed;
        top: var(--api-topbar-height);
        left: -100%;
        width: 260px;
        transition: left .3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,.15);
    }

    .api-sidebar.show {
        left: 0;
    }

    .api-main {
        padding: 24px 16px;
    }

    .api-topbar {
        padding: 0 12px;
    }

    .api-topbar .d-flex:last-child {
        display: none !important;
    }

    .api-endpoint {
        padding: 16px;
    }

    .api-endpoint-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .api-hero h1 {
        font-size: 1.4rem;
    }

    .api-code-block pre {
        padding: 12px;
    }

    .api-code-block code {
        font-size: .75rem;
    }
}
