/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Cards */
.status-card,
.form-card,
.results-card,
.docs-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.status-card h2,
.form-card h2,
.results-card h2,
.docs-card h2 {
    margin-bottom: 16px;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Toggle headers */
.toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    user-select: none;
    transition: color 0.2s;
}

.toggle-header:hover {
    color: #667eea;
}

.toggle-header h2 {
    margin: 0;
    flex: 1;
}

.toggle-header-small {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.toggle-header-small:hover {
    color: #667eea;
}

.toggle-header-small h3 {
    margin: 0;
}

.chevron {
    font-size: 0.875rem;
    color: #718096;
    transition: transform 0.3s ease;
    display: inline-block;
}

.chevron-small {
    font-size: 0.75rem;
    color: #a0aec0;
    transition: transform 0.3s ease;
    display: inline-block;
}

.toggle-header:not(.collapsed) .chevron,
.toggle-header-small:not(.collapsed) .chevron-small {
    transform: rotate(90deg);
}

.toggle-content {
    display: block;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.toggle-content.collapsed {
    display: none;
}

/* Status indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #e2e8f0;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background-color: #48bb78;
    animation: none;
}

.status-dot.error {
    background-color: #f56565;
    animation: none;
}

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

/* Form styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.form-group select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #cbd5e0;
    transform: translateY(-1px);
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.results-header h2 {
    margin: 0;
}

pre {
    margin: 0;
    padding: 16px;
    background-color: #282c34;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

pre code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #abb2bf;
    display: block;
    padding: 0;
    background: transparent;
}

/* API Documentation */
.endpoints {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
}

.method {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.method.get {
    background-color: #48bb78;
    color: white;
}

.method.post {
    background-color: #667eea;
    color: white;
}

.path {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 500;
    color: #2d3748;
}

.description {
    color: #718096;
    font-size: 14px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #718096;
    border-top: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
