/* documentation.css - Estilos específicos para a página de documentação */

/* ===================================
   BASE DA DOCUMENTAÇÃO
   =================================== */
.doc-wrapper {
    min-height: 100vh;
}

/* Cabeçalho com gradiente */
.doc-header {
    padding: 60px 0 60px;
    background: linear-gradient(135deg, 
        rgba(147, 51, 234, 0.03) 0%, 
        rgba(236, 72, 153, 0.03) 50%,
        rgba(249, 115, 22, 0.03) 100%);
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 40px;
}

.doc-header-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.doc-header-badges .badge {
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.doc-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 20px;
}

.doc-header .lead {
    font-size: 1.25rem;
    max-width: 800px;
    margin-bottom: 30px;
}

/* ===================================
   LAYOUT DE COLUNAS
   =================================== */
.doc-sidebar-sticky {
    position: sticky;
    top: 140px;
    height: calc(100vh - 160px);
    overflow-y: auto;
    padding-right: 20px;
}

.doc-main-content {
    padding-left: 40px;
    padding-bottom: 100px;
}

/* Centraliza o conteúdo em mobile */
@media (max-width: 992px) {
    .doc-main-content {
        padding-left: 0;
        text-align: center;
    }
    
    .doc-main-content .row {
        justify-content: center;
    }
    
    .doc-main-content .tech-card,
    .doc-main-content .api-endpoint-card {
        text-align: left;
    }
}

/* ===================================
   BARRA LATERAL DE NAVEGAÇÃO
   =================================== */
#doc-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-category {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bs-secondary-color);
    margin-top: 25px;
    margin-bottom: 10px;
    padding-left: 15px;
}

.nav-category:first-child {
    margin-top: 0;
}

#doc-sidebar-nav .nav-link {
    text-align: left;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    color: var(--bs-body-color);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#doc-sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: var(--gradient-primary);
    opacity: 0.1;
    transition: width 0.3s ease;
    z-index: 0;
}

#doc-sidebar-nav .nav-link:hover {
    color: var(--primary);
    border-color: rgba(147, 51, 234, 0.2);
    transform: translateX(5px);
}

#doc-sidebar-nav .nav-link:hover::before {
    width: 100%;
}

#doc-sidebar-nav .nav-link.active {
    background: rgba(147, 51, 234, 0.1);
    color: var(--primary);
    border-color: rgba(147, 51, 234, 0.3);
    font-weight: 600;
}

#doc-sidebar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

/* ===================================
   SEÇÕES DE CONTEÚDO
   =================================== */
.doc-section {
    margin-bottom: 80px;
    scroll-margin-top: 120px;
}

.doc-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bs-border-color);
    position: relative;
}

.doc-section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100px;
    height: 2px;
    background: var(--gradient-primary);
}

.doc-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
}

/* REMOVIDO: margin-top desnecessária do h4 */
.doc-section h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--bs-body-color);
}

.doc-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--bs-border-color), 
        transparent);
    border: 0;
    margin: 60px 0;
    opacity: 0.5;
}

/* ===================================
   CORREÇÕES DE CORES E ALINHAMENTOS
   =================================== */

/* Corrige a cor do texto nos cards para ser igual ao index */
.tech-card p,
.tech-card .text-body {
    color: var(--bs-body-color) !important;
}

/* Corrige alinhamento dos headers nos cards */
.tech-card-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.tech-card-header.align-items-center {
    align-items: center !important;
}

.tech-card-header .tech-icon {
    flex-shrink: 0;
}

/* Garante que os h4 dentro dos cards tenham margem consistente */
.tech-card-header h4 {
    margin-bottom: 0;
    line-height: 1.3;
}

/* Ajusta cards para ficarem iguais ao index */
.tech-card {
    background-color: var(--bs-card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color);
    display: flex;
    flex-direction: column;
}

.tech-card .text-muted {
    color: var(--bs-secondary-color) !important;
}

/* ===================================
   TABELAS PADRONIZADAS
   =================================== */
.doc-table {
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--bs-border-color);
    width: 100%;
}

.doc-table thead {
    background: rgba(147, 51, 234, 0.1);
}

.doc-table thead th {
    border-bottom: 2px solid rgba(147, 51, 234, 0.3);
    font-weight: 700;
    padding: 16px 20px;
    color: var(--bs-body-color);
    text-align: left;
}

.doc-table tbody tr {
    transition: background-color 0.2s ease;
}

.doc-table tbody tr:hover {
    background: rgba(147, 51, 234, 0.05);
}

.doc-table td {
    padding: 16px 20px;
    vertical-align: top;
    color: var(--bs-body-color);
    border-top: 1px solid var(--bs-border-color);
}

/* Dark mode específico para tabelas */
[data-bs-theme="dark"] .doc-table thead {
    background: rgba(147, 51, 234, 0.15);
}

[data-bs-theme="dark"] .doc-table thead th {
    color: #f8fafc;
    border-bottom-color: rgba(147, 51, 234, 0.4);
}

[data-bs-theme="dark"] .doc-table td {
    color: #e2e8f0;
    border-top-color: #334155;
}

/* ===================================
   TIMELINE CORRIGIDA
   =================================== */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.timeline-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--bs-body-color); /* CORRIGIDO: texto visível */
    background: var(--bs-tertiary-bg);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .timeline-number {
    color: #f8fafc;
    background: #1e293b;
    border-color: #475569;
}

/* ===================================
   COMPONENTES ESPECÍFICOS DA DOC
   =================================== */
.alert-doc {
    border-radius: 16px;
    border: 1px solid;
    padding: 24px;
    margin: 30px 0;
    background: var(--bs-body-bg);
}

.alert-doc .bi {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.code-block {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 0;
    margin: 25px 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.code-block-header {
    background: rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    border-bottom: 1px solid var(--bs-border-color);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .code-block-header {
    background: rgba(255, 255, 255, 0.05);
}

.code-block pre {
    margin: 0;
    padding: 20px;
    background: transparent !important;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
}

.code-block code {
    color: var(--bs-body-color);
    background: transparent;
    padding: 0;
}

.code-tabs-wrapper {
    margin: 25px 0;
}

.code-tabs-wrapper .nav-tabs {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px 12px 0 0;
}

[data-bs-theme="dark"] .code-tabs-wrapper .nav-tabs {
    background: rgba(255, 255, 255, 0.02);
}

.code-tabs-wrapper .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin-bottom: -1px;
}

.code-tabs-wrapper .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* ===================================
   COMPONENTES VISUAIS ADICIONAIS
   =================================== */
.api-endpoint-card {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    transition: all 0.3s ease;
}

.api-endpoint-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.api-endpoint-card .badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 6px;
}

.endpoint-method {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.endpoint-method.get { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.endpoint-method.post { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.endpoint-method.put { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.endpoint-method.delete { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.endpoint-path {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--bs-body-color);
    margin: 10px 0;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

[data-bs-theme="dark"] .endpoint-path {
    background: rgba(255, 255, 255, 0.03);
}

/* ===================================
   RESPONSIVIDADE
   =================================== */
@media (max-width: 992px) {
    .doc-header {
        padding: 80px 0 40px;
        text-align: center;
    }
    
    .doc-header-badges {
        justify-content: center;
    }
    
    .doc-header .d-flex {
        justify-content: center;
    }
    
    .doc-main-content {
        padding-left: 0;
    }
    
    .doc-sidebar-sticky {
        position: static;
        height: auto;
        margin-bottom: 40px;
        padding-right: 0;
    }
    
    #doc-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    #doc-sidebar-nav .nav-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .nav-category {
        width: 100%;
        margin-top: 20px;
        text-align: center;
    }
    
    .doc-section {
        text-align: center;
    }
    
    .doc-section h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .doc-header {
        padding: 60px 0 30px;
    }
    
    .doc-section {
        margin-bottom: 60px;
    }
    
    .api-endpoint-card {
        padding: 20px;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .timeline-number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin: 0 auto;
    }
    
    .tech-card-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* ===================================
   ANIMAÇÕES E EFEITOS
   =================================== */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.8; }
}

.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: pulse-glow 2s infinite;
}

.glow-effect:hover::before {
    opacity: 0.3;
}

/* ===================================
   COMPONENTES DE STATUS
   =================================== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-indicator.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-indicator.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-indicator.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online::before { background: #10b981; }
.status-indicator.warning::before { background: #f59e0b; }
.status-indicator.offline::before { background: #ef4444; }