/* speedtest.how — main.css */

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0f1117;
}
::-webkit-scrollbar-thumb {
    background: #2d3148;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4a4f7a;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Gradient text utility */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Code block styles */
pre {
    background: #1a1d2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

code {
    font-family: 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.875em;
    background: rgba(99,102,241,0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: #a5b4fc;
}

pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
}

/* Table overflow wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.guide-content .table-wrapper {
    margin: 1.5rem 0;
}

/* Achievement pulse animation for newly earned */
@keyframes achievement-pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.achievement-new {
    animation: achievement-pulse 2s ease-out 3;
}

/* Mobile nav transition */
nav [x-show] {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Form select styling */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.form-input option {
    background: #1a1d2e;
    color: white;
}

/* Textarea resize vertical only */
textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* Focus ring for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav, footer, aside, .btn-primary, .btn-secondary {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .guide-content p,
    .guide-content li,
    .guide-content td {
        color: #333;
    }
    .guide-content h2,
    .guide-content h3 {
        color: #111;
    }
    .card {
        border: 1px solid #ddd;
        background: white;
    }
}

/* Link styles in guide content */
.guide-content a {
    color: #6366f1;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.guide-content a:hover {
    color: #818cf8;
}

/* Status indicator dots */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot-green { background: #10b981; }
.status-dot-yellow { background: #f59e0b; }
.status-dot-red { background: #ef4444; }

/* Hero section gradient overlay */
.hero-gradient {
    background: linear-gradient(180deg, rgba(99,102,241,0.05) 0%, transparent 100%);
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1d2e;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .metric-value {
        font-size: 2rem;
    }
    h1 {
        font-size: 1.75rem;
    }
}

/* Loading state for forms */
.form-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Card hover transitions */
.card {
    transition: border-color 0.2s ease;
}

/* Blockquote in guide content */
.guide-content blockquote {
    border-left: 3px solid #6366f1;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-style: italic;
}
