/**
 * API Documentation Page Styles
 * 
 * Convertido de Tailwind para CSS puro
 * Integrado com RevBridge branding
 */

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.api-docs-page {
    background: #f8f9fa;
}

.api-docs-container {
    display: flex;
    min-height: calc(100vh - 80px);
    width: 100%;
}

/* ========================================
   SIDEBAR
   ======================================== */

.api-docs-sidebar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--red-primary);
}

.back-link .icon {
    width: 16px;
    height: 16px;
}

.sidebar-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.sidebar-nav {
    padding: 1.5rem;
}

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

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* API Navigation Buttons */
.api-nav-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: left;
    margin-bottom: 0.5rem;
}

.api-nav-button .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.api-nav-button:hover {
    background: #f3f4f6;
    color: #111827;
}

.api-nav-button.active {
    background: var(--red-primary);
    color: #ffffff;
}

/* Endpoint Group */
.endpoint-group {
    margin-bottom: 1.5rem;
}

.endpoint-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.endpoint-nav-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 0.875rem;
    text-align: left;
    margin-bottom: 0.25rem;
}

.endpoint-nav-button:hover {
    background: #f9fafb;
    color: #111827;
}

.endpoint-nav-button.active {
    background: #f3f4f6;
    color: #111827;
}

.endpoint-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.api-docs-main {
    flex: 1;
    min-width: 0;
    background: #f8f9fa;
}

.api-docs-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 2rem;
    position: sticky;
    top: 80px;
    z-index: 10;
}

.api-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(232, 17, 17, 0.1), rgba(232, 17, 17, 0.05));
    border-radius: 0.75rem;
    color: var(--red-primary);
}

.api-header-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.api-docs-content {
    padding: 2rem;
    max-width: 1200px;
}

/* ========================================
   CARDS
   ======================================== */

.api-card {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.card-content {
    color: #4b5563;
    line-height: 1.6;
}

.card-content p {
    margin: 0 0 1rem 0;
}

.card-content p:last-child {
    margin-bottom: 0;
}

/* Empty State */
.empty-state .card-content {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .card-content svg {
    width: 48px;
    height: 48px;
    color: #9ca3af;
    margin: 0 auto 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    color: #6b7280;
    margin: 0;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.input-field {
    width: 100%;
    max-width: 500px;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px rgba(232, 17, 17, 0.1);
}

.input-help {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.input-help code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* ========================================
   CODE BLOCKS
   ======================================== */

.code-block {
    background: #1e293b;
    border-radius: 0.75rem;
    overflow: hidden;
    margin: 1rem 0;
}

.code-block.terminal {
    background: #0f172a;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-header span {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.copy-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.375rem;
    color: #e2e8f0;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.copy-button.copied {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.copy-button svg {
    width: 14px;
    height: 14px;
}

.code-block pre {
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
}

/* ========================================
   ENDPOINTS
   ======================================== */

.endpoints-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.5rem 0;
}

.endpoint-card {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.endpoint-card:target {
    box-shadow: 0 0 0 2px var(--red-primary);
}

.endpoint-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.endpoint-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

/* Method Badges */
.method-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
    text-transform: uppercase;
}

.method-badge.method-get {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.method-badge.method-post {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.method-badge.method-put {
    background: #fed7aa;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.method-badge.method-patch {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.method-badge.method-delete {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.endpoint-path {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
    color: #111827;
    background: #f3f4f6;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    overflow-wrap: break-word;
    word-break: break-all;
}

.base-url-inline {
    color: #6b7280;
}

.security-badge {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: auto;
}

.endpoint-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.endpoint-description {
    color: #6b7280;
    line-height: 1.6;
}

.endpoint-content {
    padding: 1.5rem;
}

.endpoint-section {
    margin-bottom: 2rem;
}

.endpoint-section:last-child {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.75rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* ========================================
   PARAMETERS TABLE
   ======================================== */

.params-table {
    overflow-x: auto;
}

.params-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.params-table thead {
    background: #f9fafb;
}

.params-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.params-table td {
    padding: 0.75rem 1rem;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
}

.params-table code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #111827;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.badge-required {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* ========================================
   RESPONSES
   ======================================== */

.responses-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.response-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #f9fafb;
}

.response-item.success {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
}

.response-item.error {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}

.response-code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    min-width: 50px;
}

.response-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ========================================
   MARKDOWN CONTENT
   ======================================== */

.markdown-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 2rem 0 1rem 0;
}

.markdown-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 1.5rem 0 0.75rem 0;
}

.markdown-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 1rem 0 0.5rem 0;
}

.markdown-content p {
    color: #4b5563;
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.markdown-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.markdown-content li {
    color: #4b5563;
    line-height: 1.7;
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.markdown-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--red-primary);
    font-weight: bold;
}

.markdown-content strong {
    font-weight: 600;
    color: #111827;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .api-docs-sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .api-docs-container {
        flex-direction: column;
    }
    
    .api-docs-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .api-docs-header {
        position: static;
    }
    
    .api-docs-content {
        padding: 1rem;
    }
    
    .endpoint-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .security-badge {
        margin-left: 0;
    }
    
    .endpoint-path {
        font-size: 0.875rem;
        overflow-x: auto;
        max-width: 100%;
    }
    
    .params-table {
        font-size: 0.8125rem;
    }
}

