/* Relay Tester Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.security-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Tester Section */
.tester-section {
    padding: 3rem 0;
}

.tester-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.tester-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.relay-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.relay-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-test {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.input-hint {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Popular Relays */
.popular-relays {
    margin-bottom: 2rem;
}

.popular-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.relay-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.relay-chip {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s;
}

.relay-chip:hover {
    background: var(--gray-200);
    border-color: var(--primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--gray-600);
    font-size: 0.938rem;
}

/* Results */
.results {
    margin-top: 2rem;
}

.result-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.result-section:last-child {
    border-bottom: none;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1.5rem;
}

/* Connection Status */
.status-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 12px;
    border-left: 4px solid var(--gray-300);
}

.status-card.success {
    background: #d1fae5;
    border-left-color: var(--success);
}

.status-card.error {
    background: #fee2e2;
    border-left-color: var(--danger);
}

.status-card.warning {
    background: #fef3c7;
    border-left-color: var(--warning);
}

.status-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: white;
}

.status-details {
    flex: 1;
}

.status-text {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.status-meta {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-card {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 12px;
    text-align: center;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.metric-value.success {
    color: var(--success);
}

.metric-value.warning {
    color: var(--warning);
}

.metric-value.error {
    color: var(--danger);
}

/* Info Table */
.info-table {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1.5rem;
}

.info-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex: 0 0 150px;
    font-weight: 600;
    color: var(--gray-700);
}

.info-value {
    flex: 1;
    color: var(--gray-900);
}

/* NIPs Container */
.nips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nip-badge {
    padding: 0.5rem 1rem;
    background: var(--success);
    color: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.nip-badge.unsupported {
    background: var(--gray-300);
    color: var(--gray-700);
}

/* Test Result */
.test-result {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 12px;
}

.loading-text {
    color: var(--gray-600);
    font-style: italic;
}

/* Info Section */
.info-section {
    padding: 4rem 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--gray-600);
    font-size: 1.125rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card {
    text-align: center;
    padding: 2rem;
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--gray-600);
}

/* NIPs Reference */
.nips-reference {
    padding: 4rem 0;
}

.nips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.nip-card {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.nip-number {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.nip-card h3 {
    font-size: 1.063rem;
    margin-bottom: 0.5rem;
}

.nip-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.nips-footer {
    text-align: center;
}

.btn-text {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.btn-text:hover {
    gap: 1rem;
}

.arrow {
    font-size: 1.25rem;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: white;
}

.faq-grid {
    display: grid;
    gap: 1.5rem;
}

.faq-item {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.faq-item h3 {
    color: var(--primary);
    font-size: 1.063rem;
    margin-bottom: 0.75rem;
}

.faq-item p {
    color: var(--gray-700);
    line-height: 1.7;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.cta-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.cta-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-cta-primary,
.btn-cta-secondary {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-cta-primary {
    background: white;
    color: var(--primary);
}

.btn-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-cta-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gray-900);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .container {
        padding: 0 1rem;
    }
}