/* components.css - Estilos de componentes reutilizaveis */

/* Code blocks */
pre {
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

pre code {
    font-size: 14px;
    line-height: 1.6;
}

code {
    background: #282c34;
    color: #abb2bf;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: var(--primary);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

tr:nth-child(even) {
    background: var(--gray-bg);
}

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

/* Alerts/Callouts */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
}

.alert-info {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #1E40AF;
}

.alert-warning {
    background: #FFFBEB;
    border-color: var(--warning);
    color: #92400E;
}

.alert-success {
    background: #ECFDF5;
    border-color: var(--success);
    color: #065F46;
}

.alert-error {
    background: #FEF2F2;
    border-color: var(--error);
    color: #991B1B;
}

.alert strong {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Diagrams - Mermaid */
.mermaid {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Table of Contents */
#toc {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#toc ul {
    list-style: none;
    margin: 0;
}

#toc > ul {
    margin: 20px 0 0 0;
}

#toc li {
    margin: 10px 0;
}

#toc a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s;
}

#toc a:hover {
    background: var(--gray-bg);
    text-decoration: none;
    padding-left: 20px;
}

#toc ul ul {
    margin-left: 20px;
}

/* Flow diagram boxes */
.flow-box {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
    font-weight: 600;
}

.flow-arrow {
    text-align: center;
    font-size: 24px;
    color: var(--primary);
    margin: 5px 0;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.badge-method {
    background: var(--primary);
    color: white;
}

.badge-get {
    background: #10B981;
    color: white;
}

.badge-post {
    background: #3B82F6;
    color: white;
}

.badge-put {
    background: #F59E0B;
    color: white;
}

.badge-delete {
    background: #EF4444;
    color: white;
}

/* Endpoint documentation */
.endpoint {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary);
}

.endpoint-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.endpoint-method {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 15px;
    font-size: 14px;
}

.endpoint-method.get {
    background: #10B981;
}

.endpoint-method.post {
    background: #3B82F6;
}

.endpoint-method.put {
    background: #F59E0B;
}

.endpoint-method.delete {
    background: #EF4444;
}

.endpoint-path {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-bold);
}

.endpoint-description {
    margin: 15px 0;
    padding: 15px;
    background: var(--gray-bg);
    border-radius: 6px;
}

/* Status codes */
.status-code {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.status-200, .status-201 {
    background: #D1FAE5;
    color: #065F46;
}

.status-400, .status-403, .status-404, .status-500 {
    background: #FEE2E2;
    color: #991B1B;
}

/* Status badges for transaction types */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-paga {
    background: #D1FAE5;
    color: #065F46;
}

.status-isento {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-isentada {
    background: #E0E7FF;
    color: #3730A3;
}

.status-inadimplente {
    background: #FEF3C7;
    color: #92400E;
}

.status-cancelada {
    background: #FEE2E2;
    color: #991B1B;
}

.status-erro {
    background: #FEE2E2;
    color: #991B1B;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text);
    opacity: 0.7;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
