/* DownDetector API Tester - Estilos CSS */

/* Força visibilidade */
html, body {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    background: #667eea !important; /* Fallback */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh !important;
    padding: 20px !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Container Principal */
.container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 15px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    backdrop-filter: blur(10px) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    position: relative !important;
}

/* Header */
.header {
    background: linear-gradient(90deg, #2c3e50, #3498db);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Configuração da API */
.api-config {
    background: #f8f9fa;
    padding: 25px;
    border-bottom: 1px solid #e9ecef;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
}

.config-item input {
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.config-item input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.auth-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.auth-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #3498db;
    cursor: pointer;
}

.auth-toggle label {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
}

/* Layout Principal */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 70vh;
}

/* Panel de Endpoints */
.endpoints-panel {
    padding: 30px;
    border-right: 1px solid #e9ecef;
    background: #ffffff;
    overflow-y: auto;
    max-height: 80vh;
}

.endpoints-panel::-webkit-scrollbar {
    width: 6px;
}

.endpoints-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.endpoints-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.endpoints-panel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Panel de Resposta */
.response-panel {
    padding: 30px;
    background: #f8f9fa;
}

.section-title {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 30%;
    height: 3px;
    background: #e74c3c;
}

/* Grupos de Endpoints */
.endpoint-group {
    margin-bottom: 35px;
}

.endpoint-group h3 {
    color: #27ae60;
    margin-bottom: 18px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 2px solid #ecf0f1;
}

.endpoint-group h3::before {
    content: "🔗";
    font-size: 1.4em;
}

/* Endpoints */
.endpoint {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.endpoint:hover {
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.endpoint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    cursor: pointer;
    transition: all 0.3s ease;
}

.endpoint-header:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.endpoint-method {
    background: #27ae60;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 45px;
    text-align: center;
}

.endpoint-method.post {
    background: #e74c3c;
}

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

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

.endpoint-path {
    font-family: 'Courier New', monospace;
    color: #2c3e50;
    font-weight: bold;
    margin-left: 15px;
    font-size: 14px;
}

.endpoint-body {
    padding: 20px;
    display: none;
    background: #fafbfc;
    border-top: 1px solid #e9ecef;
}

.endpoint-body.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.endpoint-description {
    color: #6c757d;
    margin-bottom: 18px;
    font-style: italic;
    padding: 12px;
    background: rgba(52, 152, 219, 0.05);
    border-left: 4px solid #3498db;
    border-radius: 0 6px 6px 0;
}

/* Parâmetros */
.endpoint-params {
    margin-bottom: 18px;
}

.param-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.param-item input[type="text"],
.param-item input[type="number"],
.param-item input[type="password"] {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    flex: 1;
    transition: all 0.3s ease;
}

.param-item input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.param-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.param-item label {
    min-width: 100px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* Botões */
.test-button {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-button:hover {
    background: linear-gradient(45deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.test-button:active {
    transform: translateY(0);
}

.test-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clear-button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.clear-button:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Container de Resposta */
.response-container {
    background: #2c3e50;
    border-radius: 10px;
    padding: 25px;
    min-height: 450px;
    font-family: 'Courier New', monospace;
    color: #ecf0f1;
    overflow-y: auto;
    max-height: 70vh;
    position: relative;
}

.response-container::-webkit-scrollbar {
    width: 8px;
}

.response-container::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 4px;
}

.response-container::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

.response-container::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Headers de Resposta */
.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #34495e;
    flex-wrap: wrap;
    gap: 10px;
}

.response-header button {
    transition: all 0.3s ease;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.response-header button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-success {
    background: #27ae60;
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.status-error {
    background: #e74c3c;
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.status-pending {
    background: #f39c12;
    color: white;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.response-meta {
    color: #95a5a6;
    font-size: 13px;
    margin-bottom: 20px;
    border-bottom: 1px solid #34495e;
    padding-bottom: 15px;
    line-height: 1.8;
}

.response-body {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #34495e;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #f39c12;
    margin-top: 100px;
    font-size: 16px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #34495e;
    border-top: 3px solid #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* JSON Payload */
.json-payload {
    margin-top: 15px;
}

.json-payload textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.json-payload textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Responsividade */
@media (max-width: 1200px) {
    .container {
        margin: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .endpoints-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        max-height: 50vh;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .endpoint-header {
        padding: 15px;
    }
    
    .endpoint-body {
        padding: 15px;
    }
    
    .response-panel,
    .endpoints-panel {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .param-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .param-item label {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .response-container {
        min-height: 300px;
        font-size: 12px;
    }
}

/* Melhorias de acessibilidade */
.endpoint-header:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.test-button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Estados especiais */
.endpoint.testing {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.05);
    animation: pulse 2s ease-in-out infinite;
}

.endpoint.success {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
    animation: successFlash 1s ease-out;
}

.endpoint.error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
    animation: errorShake 0.5s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes successFlash {
    0% { background: rgba(39, 174, 96, 0.3); }
    100% { background: rgba(39, 174, 96, 0.05); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Animações sutis */
.config-item input,
.param-item input,
.test-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.endpoint {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container {
        box-shadow: none;
        background: white;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .response-panel {
        page-break-before: always;
    }
}
