:root {
    --var1: #ffffff; /* white */
    --color-meta: #acfddf; /* light aqua green */
    --color-primary: #3fc091; /* medium teal */
    --color-secondary: #22906c; /* dark teal */
    --var1: #1a1c3f; /* navy blue */
    --color-muted: #888888;
}

* {
    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: #fafafa;
    background: #141414;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    color-scheme: dark;
    accent-color: var(--color-primary);
}

input, select, textarea {
    font-family: inherit;
}

a {
    color: var(--color-secondary);
}
a:hover {
    color: var(--color-primary);
}
a:not(:is(:hover,:focus)) {
    text-decoration-color: color-mix(in srgb, currentColor, transparent 75%);
}

.container {
    width: 80%;
    max-width: 1920px;

    margin: 0 auto;
    padding: 2em;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1em;
    line-height: 1.25;
}

.header .author {
    display: block;
    font-size: 14px;
    font-weight: 400;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Input section */
.input-section {
    padding: 1em;
    background: rgb(24, 31, 37);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, #141414 10px, #141414 11px);
    border: 0.834783px solid rgb(41, 51, 61);
    border-radius: 6px;

    margin-bottom: 2em;
}

.checker-form {
    max-width: 720px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 1;
    min-width: 300px;
    padding: 18px 24px;
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #141414;
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-meta);
}

.input-group button {
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.input-group button:hover {
    transform: translateY(-2px);
}

.input-group button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.loading-spinner.show,
button .loading-spinner.show {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button text transition */
.button-text {
    transition: all 0.3s ease;
}

/* Progress Indicator */
.progress-indicator {
    padding: 1em;
    background: rgb(24, 31, 37);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, #141414 10px, #141414 11px);
    border: 0.834783px solid rgb(41, 51, 61);
    border-radius: 6px;

    margin-bottom: 2em;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
}

.progress-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e5e9;
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-meta);
}

.progress-container {
    max-width: 600px;
    margin: 0 auto;
}

.loading-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Options */
.cache-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgb(41, 51, 61);
}

.cache-checkbox {
    display: flex;
    align-items: center;
    gap: 0.334em;
    cursor: pointer;
    font-size: 14px;
    color: #fafafa;
}

.cache-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cache-options small {
    color: var(--color-muted);
    font-size: 12px;
    display: block;
    margin-left: 28px;
    margin-bottom: 0.334em;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* Responsive design for mobile */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-column {
        padding: 15px;
    }
    
    .stats-value {
        font-size: 1.5rem;
    }
    
    .stats-list-item {
        font-size: 0.8rem;
    }
}

.stats-column {
    padding: 1em;
    background: rgb(24, 31, 37);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, #141414 10px, #141414 11px);
    border: 0.834783px solid rgb(41, 51, 61);
    border-radius: 6px;

    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-column:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.stats-column h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #fafafa;
    font-weight: 600;
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
}

.stats-list {
    overflow-y: auto;
}

.stats-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgb(41, 51, 61);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stats-list-item:last-child {
    border-bottom: none;
}

.stats-list-item .url {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4a5568;
}

.stats-list-item .score {
    font-family: "geist mono";
    font-weight: 600;
    color: var(--color-meta);
    margin-left: 10px;
}

.stats-list-item .date {
    font-size: 0.8rem;
    color: #718096;
    margin-left: 10px;
}

.loading-placeholder {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.input-group button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}



@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results section */
.results-section {
}

.overview-section {
    margin-bottom: 40px;
}

.overview-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
}

.score-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.score-card {
    position: relative;

    padding: 1em;
    background: rgb(24, 31, 37);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, #141414 10px, #141414 11px);
    border: 0.834783px solid rgb(41, 51, 61);
    border-radius: 6px;

    text-align: center;
    transition: all 0.3s ease;
}

.score-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.score-icon {
    margin-bottom: 0.334em;
}
.score-icon img {
    height: 48px;
    opacity: 0.25;
}

.score-content h3 {
    font-size: 0.9rem;
    color: #fafafa;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.score-content a {
    text-decoration: none;
}
.score-content a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.score-value {
    font-family: "geist mono";
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.score-excellent { color: #38a169; }
.score-good { color: #3182ce; }
.score-warning { color: #d69e2e; }
.score-poor { color: #e53e3e; }
.score-loading { color: #a0aec0; }
.score-info { color: #718096; }

/* Detailed results */
.detailed-results {
    display: grid;
    gap: 30px;
}

.result-section {
}

.result-section h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.section-content {
    min-height: 50px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1em;
}

.loading-placeholder {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.loading-section {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.loading-section .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-section p {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.error-section {
    text-align: center;
    padding: 20px;
    color: #e53e3e;
    background: #fed7d7;
    border-radius: 8px;
    border: 1px solid #feb2b2;
}

.error-section p {
    margin: 0;
    font-weight: 500;
}

/* Check items */
.check-item {
    display: flex;
    flex-direction: column;
    gap: 1em;
    padding: 1em;

    background: rgb(24, 31, 37);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, #141414 10px, #141414 11px);

    border: 0.834783px solid rgb(41, 51, 61);
    border-radius: 6px;
}

.check-item:last-child {
    border-bottom: none;
}

.check-item-left {
    display: flex;
    gap: 1em;
    flex: 1;
}

.check-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.check-icon.success { color: #38a169; }
.check-icon.warning { color: #d69e2e; }
.check-icon.error { color: #e53e3e; }
.check-icon.info { color: #3182ce; }

.check-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fafafa;
    margin-bottom: 2px;
}

.check-details p {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0;
}

.check-details .explanation {
    font-size: 0.8rem;
    color: #cccccc;
    font-style: italic;
    margin-top: 5px;
    line-height: 1.4;
}

.check-status {
    display: inline-flex;
    align-self: end;
 
    width: fit-content;

    line-height: 16px;
    padding: 2px 10px;

    border-radius: 9999px;
    text-transform: capitalize;

    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-feature-settings: normal;
    font-size: 12px;
    font-variation-settings: normal;
    font-weight: 600;
}

.status-success {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.4);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.2);
}

.status-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.2);
}

.status-error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.2);
}

.status-info {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.2);
}

/* Technology badges */
.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tech-badge {
    display: inline-flex;
    align-self: end;
 
    width: fit-content;

    line-height: 16px;
    padding: 2px 10px;

    border-radius: 9999px;

    font-family: "Geist Mono", system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 12px;
    font-weight: 400;

    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}



/* Error message */
.error-message {
    background: #fed7d7;
    color: #742a2a;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #feb2b2;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group input {
        min-width: auto;
    }
    
    .score-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .performance-grid {
        grid-template-columns: 1fr;
    }
    
    .check-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .check-status {
        align-self: flex-end;
    }
    

}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeIn 0.5s ease-out;
}

.score-card {
    animation: fadeIn 0.5s ease-out;
}

.section-complete {
    animation: sectionComplete 0.6s ease-out;
}

@keyframes sectionComplete {
    0% {
        opacity: 0.7;
        transform: scale(0.98);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Progress bar for loading states */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}



/* Enhanced performance metrics */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.metric-card {
    background: #141414;
    padding: 1em;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fafafa;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--color-muted);
    font-weight: 500;
}

.load-time-ms {
    font-size: 1.1rem;
    color: var(--color-primary);
}

.load-time-seconds {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-top: 2px;
}

/* Waterfall link styling */
.waterfall-link {
    margin-top: 15px;
    text-align: center;
}

.waterfall-link .btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.waterfall-link .btn:hover {
    background: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
