:root {
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --secondary: #818CF8;
    --accent: #F59E0B;
    --success: #10B981;
    --error: #EF4444;
    --warn: #F59E0B;
    --bg: #0F1219;
    --surface: #1E2330;
    --surface-hover: #272D3D;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border: rgba(99, 102, 241, 0.2);
    --border-focus: rgba(129, 140, 248, 0.6);
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.app-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism Helpers */
.glass-panel {
    background: rgba(30, 35, 48, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Header */
.header {
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.accent-text {
    color: var(--accent);
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Panels */
.panel {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

/* Form */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.row-group {
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.method-wrapper {
    width: 120px;
    flex-shrink: 0;
}

.url-input-wrapper {
    flex: 1;
}

.form-group label,
.input-wrapper label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Alert Box */
.alert-box {
    flex-direction: row;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    gap: 1rem;
}

.alert-icon {
    color: var(--secondary);
    margin-top: 2px;
}

.alert-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.alert-content code {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

/* Headers Section */
.headers-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-top h3 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.text-btn {
    background: none;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.text-btn:hover {
    color: var(--primary);
    text-decoration: underline;
}

.headers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.header-input-row {
    display: flex;
    gap: 0.5rem;
    animation: slideIn 300ms ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-key {
    flex: 1;
}

.header-val {
    flex: 1.5;
}

.icon-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
    border-radius: 8px;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Submit Area */
.form-actions {
    margin-top: 1rem;
}

.primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1.1rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

.loader.hidden {
    display: none;
}

.btn-text.hidden {
    display: none;
}

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

/* Results Area */
.results-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 500ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.title-with-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-with-status h2 {
    border-bottom: none;
    padding-bottom: 0;
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
}

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

.status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.status-badge.network-error {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warn);
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Checks */
.checks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.check-item.pass {
    border-left-color: var(--success);
}

.check-item.fail {
    border-left-color: var(--error);
}

.check-item.warn {
    border-left-color: var(--warn);
}

.check-icon {
    margin-top: 2px;
}

.check-item.pass .check-icon {
    color: var(--success);
}

.check-item.fail .check-icon {
    color: var(--error);
}

.check-item.warn .check-icon {
    color: var(--warn);
}

.check-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.check-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.check-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    word-break: break-all;
}

/* Suggestions */
.suggestions-box {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 1.25rem;
}

.suggestions-box h3 {
    color: var(--error);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#suggestions-list {
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

#suggestions-list li {
    margin-bottom: 0.5rem;
}

#suggestions-list code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    color: var(--text-primary);
}

/* Raw Headers */
.raw-response h4 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

pre {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

pre.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

code.language-http {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #a6e22e;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 600px) {
    .row-group {
        flex-direction: column;
        align-items: stretch;
    }

    .method-wrapper {
        width: 100%;
    }

    .header-input-row {
        flex-direction: column;
    }
}