/* CSS Custom Properties */
:root {
    /* Light theme colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --green-400: #4ade80;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --yellow-400: #facc15;
    --purple-400: #c084fc;
    --red-400: #f87171;
    
    /* Background colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-hero: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    
    /* Text colors */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    /* Border colors */
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Dark theme colors */
[data-theme="dark"] {
    --primary-50: #1e3a8a;
    --primary-100: #1e40af;
    --primary-500: #3b82f6;
    --primary-600: #60a5fa;
    --primary-700: #93c5fd;
    
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #ffffff;
    
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-hero: linear-gradient(135deg, #111827 0%, #1e3a8a 100%);
    
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    
    --border-primary: #374151;
    --border-secondary: #4b5563;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Styles */
.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    color: var(--primary-600);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-toggle {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
}

.theme-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
    color: var(--yellow-400);
}

/* Hero Section */
.hero {
    background: var(--bg-hero);
    padding: 5rem 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.icon-glow {
    position: absolute;
    inset: 0;
    background: var(--primary-600);
    border-radius: 50%;
    blur: 1rem;
    opacity: 0.2;
    animation: pulse 2s infinite;
}

.network-icon {
    position: relative;
    width: 4rem;
    height: 4rem;
    color: var(--primary-600);
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

.main-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.accent-text {
    display: block;
    color: var(--primary-600);
    margin-top: 0.5rem;
}

.description {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

[data-theme="dark"] .feature {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
}

.feature-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Testing Section */
.testing-section {
    padding: 4rem 0;
    background-color: var(--bg-primary);
}

.testing-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.testing-form-container {
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2rem;
}

.testing-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-select,
.form-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.run-test-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: var(--primary-600);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.run-test-btn:hover:not(:disabled) {
    background-color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.run-test-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.loading-icon {
    display: none;
    animation: spin 1s linear infinite;
}

.run-test-btn.loading .play-icon {
    display: none;
}

.run-test-btn.loading .loading-icon {
    display: block;
}

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

/* Results Section */
.results-section {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
}

.results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.results-card {
    background-color: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.results-header {
    background-color: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.results-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.results-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--green-400);
}

.results-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clock-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.timestamp {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.results-content {
    padding: 1.5rem;
}

.terminal {
    background-color: var(--gray-900);
    border-radius: 0.5rem;
    padding: 1.5rem;
    min-height: 400px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    position: relative;
}

[data-theme="dark"] .terminal {
    background-color: #000000;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--gray-600);
    border-top: 2px solid var(--blue-400);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.terminal-output {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terminal-output.show {
    opacity: 1;
}

.terminal-placeholder {
    color: var(--gray-500);
    text-align: center;
    padding: 2rem 0;
}

.terminal-line {
    margin-bottom: 0.25rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.highlight-default {
    color: var(--gray-300);
}

.highlight-time {
    color: var(--green-400);
}

.highlight-error {
    color: var(--red-400);
}

.highlight-header {
    color: var(--blue-400);
    font-weight: 600;
}

.highlight-hop {
    color: var(--yellow-400);
}

/* Footer */
.footer {
    background-color: var(--gray-900);
    color: white;
    padding: 3rem 0 1.5rem;
}

[data-theme="dark"] .footer {
    background-color: #000000;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-main {
    max-width: 400px;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--gray-400);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon {
    width: 1rem;
    height: 1rem;
    color: var(--green-400);
}

.status-text {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.footer-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: var(--gray-400);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

.link-icon,
.external-icon {
    width: 1rem;
    height: 1rem;
}

.external-icon {
    width: 0.75rem;
    height: 0.75rem;
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .features {
        gap: 1rem;
    }
    
    .feature {
        padding: 0.75rem 1.5rem;
    }
    
    .testing-section {
        padding: 3rem 0;
    }
    
    .testing-form-container {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .results-section {
        padding: 3rem 0;
    }
    
    .terminal {
        padding: 1rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero-container,
    .testing-container,
    .results-container,
    .footer-container {
        padding: 0 0.75rem;
    }
    
    .testing-form-container {
        padding: 1rem;
    }
    
    .features {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .feature {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .run-test-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
}