/* css/style.css - Estilos compartilhidos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* Header e Navegação */
.header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 small {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.8;
}

.nav-tables {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-tables a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s;
    font-size: 14px;
}

.nav-tables a:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.nav-tables a.active {
    background: rgba(255,255,255,0.3);
    font-weight: bold;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Cards e painéis */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8f0fe;
}

.card-header h2 {
    color: #1a73e8;
    font-size: 20px;
}

.card-header .badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Grid de endpoints */
.endpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.endpoint-btn {
    padding: 12px 16px;
    border: 2px solid #e8f0fe;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

.endpoint-btn:hover {
    border-color: #1a73e8;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.endpoint-btn.active {
    border-color: #1a73e8;
    background: #e8f0fe;
    color: #1a73e8;
}

.endpoint-btn .method {
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
}

.method-get { color: #34a853; }
.method-post { color: #fbbc04; }
.method-put { color: #4285f4; }
.method-delete { color: #ea4335; }

.endpoint-btn.active .method-get,
.endpoint-btn.active .method-post,
.endpoint-btn.active .method-put,
.endpoint-btn.active .method-delete {
    color: inherit;
}

/* Info do Endpoint */
.endpoint-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #1a73e8;
}

.endpoint-info .url {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #1a73e8;
    word-break: break-all;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 5px;
}

.endpoint-info .method-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    margin-right: 10px;
}

.badge-get { background: #e6f4ea; color: #34a853; }
.badge-post { background: #fef7e0; color: #fbbc04; }
.badge-put { background: #e8f0fe; color: #4285f4; }
.badge-delete { background: #fce8e6; color: #ea4335; }

.endpoint-description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.endpoint-description code {
    background: #e8f0fe;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #1a73e8;
}

/* Formulário */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}

.form-group label .required {
    color: #ea4335;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: 'Courier New', monospace;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-size: 13px;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

/* Filtros GET */
.filtros-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px dashed #dadce0;
}

.filtros-container h4 {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.filtros-grid input,
.filtros-grid select {
    padding: 8px 10px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

/* Botões */
.btn-primary {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e8f0fe;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Resposta */
.response-section {
    margin-top: 20px;
    border-top: 2px solid #e8f0fe;
    padding-top: 20px;
}

.response-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}

.response-meta .status {
    font-weight: bold;
}

.status-success { color: #34a853; }
.status-error { color: #ea4335; }

#response {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    min-height: 100px;
    max-height: 500px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

#response.error {
    background: #fce8e6;
    color: #d93025;
}

#response.success {
    background: #e6f4ea;
    color: #1e7e34;
}

/* Descrição da API */
.api-description {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #1a73e8;
}

.api-description h4 {
    color: #1a73e8;
    margin-bottom: 8px;
}

.api-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.api-description ul li {
    padding: 4px 0;
    font-size: 14px;
    color: #555;
}

.api-description ul li:before {
    content: "• ";
    color: #1a73e8;
    font-weight: bold;
}

.api-description code {
    background: #e8f0fe;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #1a73e8;
}

/* Toast de cópia */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.btn-copy {
    background: none;
    border: none;
    color: #1a73e8;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #e8f0fe;
}

/* Responsivo */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .nav-tables {
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .endpoint-grid {
        grid-template-columns: 1fr 1fr;
    }

    .container {
        padding: 0 10px;
    }

    .card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .endpoint-grid {
        grid-template-columns: 1fr;
    }
}