/* Happy Eyeballs Test Page Styling */

:root {
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    --running-color: #9c27b0;
}

/* Test Status Overview */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--background-secondary);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.status-item .status-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.status-item .status-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: center;
}

.status-item .status-value {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-item.running {
    border-color: var(--running-color);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-item.passed {
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.status-item.failed {
    border-color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
}

.status-item.warning {
    border-color: var(--warning-color);
    background: rgba(255, 152, 0, 0.1);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

/* Test Actions */
.test-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-primary, .btn-secondary, .btn-test {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--background-tertiary);
}

.btn-test {
    background: var(--accent-blue);
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.btn-test:hover {
    background: #0056b3;
}

/* Test Sections */
.test-section {
    position: relative;
}

.test-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.test-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: bold;
}

.test-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: var(--info-color);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-badge.passive {
    background: var(--warning-color);
}

.test-description {
    color: var(--text-muted);
    margin: 0.75rem 0 1rem 0;
    line-height: 1.6;
}

/* Test Results */
.test-results {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--background-secondary);
    border-radius: 8px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.result-item {
    padding: 1rem;
    background: var(--background-primary);
    border-radius: 6px;
    border-left: 3px solid var(--info-color);
}

.result-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.result-item span {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Timing Test Styles */
.timing-chart {
    margin-bottom: 1.5rem;
}

.timing-row {
    display: grid;
    grid-template-columns: 150px 1fr 80px 40px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--background-primary);
    border-radius: 6px;
    border-left: 3px solid var(--info-color);
}

.timing-row.success {
    border-left-color: var(--success-color);
}

.timing-row.failed {
    border-left-color: var(--error-color);
}

.timing-host {
    font-weight: 600;
}

.timing-bar {
    position: relative;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.timing-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--info-color));
    border-radius: 12px;
    transition: width 0.5s ease;
}

.timing-row.failed .timing-fill {
    background: linear-gradient(90deg, var(--error-color), var(--warning-color));
}

.timing-value {
    font-weight: 600;
    text-align: right;
}

.timing-status {
    font-size: 1.2rem;
    text-align: center;
}

.timing-analysis {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background-primary);
    border-radius: 6px;
}

.timing-analysis h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.timing-analysis ul {
    margin: 0;
    padding-left: 1.5rem;
}

.timing-analysis li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.timing-analysis li.good {
    color: var(--success-color);
}

.timing-analysis li.warning {
    color: var(--warning-color);
}

.timing-analysis li.bad {
    color: var(--error-color);
}

/* Race Test Styles */
.race-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.race-result-card {
    padding: 1.5rem;
    background: var(--background-primary);
    border-radius: 8px;
    border: 2px solid transparent;
}

.race-result-card.success {
    border-color: var(--success-color);
}

.race-result-card.failed {
    border-color: var(--error-color);
}

.race-result-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.race-detail {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--background-secondary);
    border-radius: 4px;
}

.race-detail strong {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.race-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.race-status.good {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success-color);
}

.race-status.bad {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error-color);
}

.race-analysis {
    padding: 1rem;
    background: var(--background-primary);
    border-radius: 6px;
}

.race-analysis h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.race-analysis ul {
    margin: 0;
    padding-left: 1.5rem;
}

.race-analysis li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.race-analysis li.good {
    color: var(--success-color);
}

.race-analysis li.warning {
    color: var(--warning-color);
}

.race-analysis li.bad {
    color: var(--error-color);
}

.race-analysis li.info {
    color: var(--info-color);
}

/* Info/Warning Boxes */
.info-content {
    line-height: 1.7;
}

.info-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-content li {
    margin-bottom: 0.5rem;
}

.warning-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid var(--warning-color);
    border-radius: 4px;
}

.success-box {
    padding: 1.5rem;
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--success-color);
    border-radius: 4px;
}

.success-box strong {
    color: var(--success-color);
    font-size: 1.1rem;
}

.success-box ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.success-box li {
    margin-bottom: 0.5rem;
}

.success-box .note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--background-secondary);
    border-radius: 4px;
    font-style: italic;
}

/* Final Results */
.verdict-box {
    margin-bottom: 1.5rem;
}

.verdict-good, .verdict-warning, .verdict-bad {
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid;
}

.verdict-good {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success-color);
}

.verdict-warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: var(--warning-color);
}

.verdict-bad {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--error-color);
}

.verdict-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.verdict-icon {
    font-size: 2.5rem;
}

.verdict-title {
    font-size: 1.5rem;
    font-weight: bold;
    flex: 1;
}

.verdict-score {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: var(--background-secondary);
    border-radius: 6px;
}

.recommendation-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.recommendation-section.good {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: var(--success-color);
}

.recommendation-section.issues {
    background: rgba(255, 152, 0, 0.1);
    border-left-color: var(--warning-color);
}

.recommendation-section.tips {
    background: rgba(33, 150, 243, 0.1);
    border-left-color: var(--info-color);
}

.recommendation-section h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.recommendation-section ul {
    margin: 0;
    padding-left: 1.5rem;
}

.recommendation-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Technical Section */
.technical-section h3 {
    color: var(--accent-blue);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.technical-section h3:first-child {
    margin-top: 0;
}

.technical-section ul, .technical-section ol {
    line-height: 1.8;
    margin: 1rem 0;
}

.technical-section li {
    margin-bottom: 0.5rem;
}

.technical-section code {
    background: var(--background-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.technical-section table {
    font-size: 0.95rem;
}

.technical-section table td,
.technical-section table th {
    vertical-align: top;
}

.info-box {
    line-height: 1.6;
}

.info-box p:first-child {
    margin-top: 0;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box ul {
    margin: 0.75rem 0;
}

.info-box li {
    margin-bottom: 0.5rem;
}

.info-box strong {
    color: var(--text-primary);
}

.info-box code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.resource-item {
    padding: 1.5rem;
    background: var(--background-secondary);
    border-radius: 8px;
    border-top: 3px solid var(--accent-blue);
    transition: transform 0.2s ease;
}

.resource-item:hover {
    transform: translateY(-4px);
}

.resource-item h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.resource-item p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.resource-item a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.resource-item a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

footer p {
    margin: 0.5rem 0;
}

footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .status-grid {
        grid-template-columns: 1fr;
    }

    .timing-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .timing-bar {
        order: 3;
    }

    .test-actions {
        flex-direction: column;
    }

    .verdict-header {
        flex-direction: column;
        text-align: center;
    }

    .verdict-score {
        width: 100%;
    }
}
