/* ============================================
   Fahro API Tester - Frontend Styles
   ============================================ */

:root {
    --fat-primary: #2563eb;
    --fat-primary-dark: #1e40af;
    --fat-success: #10b981;
    --fat-danger: #ef4444;
    --fat-warning: #f59e0b;
    --fat-gray-50: #f9fafb;
    --fat-gray-100: #f3f4f6;
    --fat-gray-200: #e5e7eb;
    --fat-gray-300: #d1d5db;
    --fat-gray-600: #4b5563;
    --fat-gray-700: #374151;
    --fat-gray-900: #111827;
    --fat-border-radius: 8px;
    --fat-border-radius-lg: 12px;
}

.fahro-api-tester {
    background: #fff;
    border-radius: var(--fat-border-radius-lg);
    overflow: hidden;
    margin: 2rem 0;
}

/* Header */
.fat-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 2rem;
    color: #fff;
    text-align: center;
}

.fat-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.fat-subtitle {
    margin: 0.5rem 0 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Main layout */
.fat-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    min-height: 500px;
}

.fat-sidebar {
    background: var(--fat-gray-50);
    border-right: 1px solid var(--fat-gray-200);
    overflow-y: auto;
    max-height: 600px;
    padding: 0;
}

.fat-main {
    padding: 2rem;
    background: #fff;
    position: relative;
}

/* Sections */
.fat-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--fat-gray-200);
}

.fat-section:last-child {
    border-bottom: none;
}

.fat-section-title {
    margin: 0 0 1rem;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fat-gray-700);
}

.fat-section-hint {
    margin: 0 0 1rem;
    font-size: 12px;
    color: var(--fat-gray-600);
    font-style: italic;
}

/* Endpoint list */
.fat-endpoint-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fat-endpoint-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--fat-gray-200);
    border-radius: var(--fat-border-radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: var(--fat-gray-900);
}

.fat-endpoint-btn:hover {
    background: var(--fat-primary);
    color: #fff;
    border-color: var(--fat-primary);
    transform: translateX(2px);
}

.fat-endpoint-btn:active {
    transform: translateX(1px);
}

.fat-method {
    display: inline-block;
    font-weight: 600;
    font-size: 11px;
    padding: 2px 6px;
    background: var(--fat-gray-200);
    border-radius: 3px;
    white-space: nowrap;
}

.fat-endpoint-btn:hover .fat-method {
    background: rgba(255, 255, 255, 0.25);
}

.fat-label {
    flex: 1;
    white-space: normal;
    line-height: 1.3;
}

/* Custom endpoint */
.fat-custom-endpoint {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fat-input {
    padding: 8px 12px;
    border: 1px solid var(--fat-gray-300);
    border-radius: var(--fat-border-radius);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--fat-gray-900);
}

.fat-input:focus {
    outline: none;
    border-color: var(--fat-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.fat-btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--fat-border-radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fat-btn-secondary {
    background: var(--fat-primary);
    color: #fff;
}

.fat-btn-secondary:hover {
    background: var(--fat-primary-dark);
}

.fat-btn-secondary:active {
    transform: scale(0.98);
}

/* Response Container */
.fat-response-container {
    background: var(--fat-gray-100);
    border: 1px solid var(--fat-gray-200);
    border-radius: var(--fat-border-radius-lg);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.fat-response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--fat-gray-200);
    border-bottom: 1px solid var(--fat-gray-300);
}

.fat-response-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--fat-gray-900);
}

.fat-copy-btn {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--fat-gray-300);
    border-radius: var(--fat-border-radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fat-copy-btn:hover {
    background: var(--fat-gray-50);
}

.fat-copy-btn.copied {
    background: var(--fat-success);
    color: #fff;
    border-color: var(--fat-success);
}

.fat-response-body {
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.fat-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--fat-border-radius);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.fat-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--fat-success);
}

.fat-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--fat-danger);
}

.fat-response-content {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--fat-gray-900);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #fff;
    border-radius: var(--fat-border-radius);
    padding: 1rem;
    border: 1px solid var(--fat-gray-300);
}

/* Empty state */
.fat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--fat-gray-600);
    text-align: center;
}

.fat-empty-icon {
    font-size: 48px;
    margin-bottom: 1rem;
}

.fat-empty-state h3 {
    margin: 0 0 0.5rem;
    font-size: 18px;
    color: var(--fat-gray-900);
}

.fat-empty-state p {
    margin: 0;
    font-size: 14px;
    color: var(--fat-gray-600);
}

/* Loading state */
.fat-loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* Status indicators */
.fat-status-200 { color: var(--fat-success); }
.fat-status-400 { color: var(--fat-warning); }
.fat-status-500 { color: var(--fat-danger); }

/* Responsive */
@media (max-width: 768px) {
    .fat-content {
        grid-template-columns: 1fr;
    }

    .fat-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--fat-gray-200);
        max-height: 250px;
    }

    .fat-main {
        padding: 1rem;
    }

    .fat-header {
        padding: 1.5rem 1rem;
    }

    .fat-title {
        font-size: 22px;
    }
}
