body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Site Header Section */
#site-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 32px 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

#site-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: translate(30px, -30px);
}

#site-header h1 {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-domain {
    font-size: 20px;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.site-domain:hover {
    color: #93c5fd;
}

.site-domain::before {
    content: '🌐';
    font-size: 16px;
}

.page-url {
    font-size: 14px;
    color: #cbd5e1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: rgba(255,255,255,0.1);
    padding: 8px 12px;
    border-radius: 6px;
    word-break: break-all;
}

.page-url.same-as-domain {
    display: none;
}

#page-ts {
    font-size: 12px;
    color: #cbd5e1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    padding: 0px 12px;
}

#reanalysis-button {
  margin: 0px 15px;
  font-size:12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  border: 1px solid #f36;
  color: white;
}

/* Main Content */
.main-content {
    padding: 40px;
}

.loading {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading h2 {
    color: #667eea;
    margin: 0 0 10px 0;
    font-weight: 600;
    font-size: 24px;
}

.loading p {
    color: #6b7280;
    margin: 0;
    font-size: 16px;
}

.results {
    display: block;
}

/* Score Container */
.score-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 32px;
    margin: 24px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.score-display h3 {
    text-align: center;
    margin: 0 0 24px 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Circular Score Value */
.score-value {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    position: relative;
    background: conic-gradient(
        #6366f1 0deg,
        #6366f1 var(--score-angle, 0deg),
        #e5e7eb var(--score-angle, 0deg),
        #e5e7eb 360deg
    );
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.score-value::before {
    content: '';
    position: absolute;
    width: 110px;
    height: 110px;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

.score-value::after {
    content: attr(data-score);
    position: absolute;
    z-index: 2;
    color: #6366f1;
    font-weight: 800;
}

/* Score Status */
.score-status {
    text-align: center;
    margin-bottom: 32px;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
}

.score-status.complete {
    background: #dcfce7;
    color: #166534;
    border: 2px solid #bbf7d0;
}

.score-status.complete::before {
    content: '✓ ';
    font-weight: bold;
}

/* Score Breakdown */
.score-breakdown h4 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.breakdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.breakdown-item>.breakdown-weight {
   display: none; 
}

.breakdown-name {
    flex: 1;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
}

.breakdown-score {
    font-weight: 700;
    font-size: 18px;
    margin-right: 16px;
    color: #111827;
}

.breakdown-item::after {
    content: '';
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(
        to right,
        var(--bar-color) 0%,
        var(--bar-color) var(--score-percent),
        #e5e7eb var(--score-percent),
        #e5e7eb 100%
    );
}

.breakdown-item[data-score="100"]::after,
.breakdown-item[data-score^="9"]::after {
    --bar-color: #10b981;
}

.breakdown-item[data-score^="8"]::after {
    --bar-color: #84cc16;
}

.breakdown-item[data-score^="7"]::after {
    --bar-color: #eab308;
}

.breakdown-item[data-score^="6"]::after {
    --bar-color: #f59e0b;
}

.breakdown-item::after {
    --bar-color: #ef4444;
}

/* Section Header */
.section-header {
    margin: 40px 0 24px 0;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Result Sections */
.result-section {
    margin-bottom: 24px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
}

.result-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.result-section > h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 24px 28px;
    color: white;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.result-section > h4 {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    margin: 0;
    padding: 10px 28px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 1em;
}

.result-section > p {
    margin: 0 28px 20px 28px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.7;
}

.result-score {
    background: rgba(255,255,255,0.25);
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 18px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.result-section > ul {
    list-style: none;
    margin: 0;
    padding: 24px 28px;
    background: #fafbfc;
}

.result-section > ul > li {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    border-left: 4px solid;
    background: white;
    font-size: 15px;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.result-section > ul > li:last-child {
    margin-bottom: 0;
}

.result-section > ul > li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Severity styling */
.sev-high {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.sev-medium {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.sev-low {
    border-left-color: #eab308;
    background: #fefce8;
    color: #713f12;
}

.sev-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.sev-high::before {
    content: '⚠️ ';
    margin-right: 8px;
}

.sev-medium::before {
    content: '⚡ ';
    margin-right: 8px;
}

.sev-low::before {
    content: '💡 ';
    margin-right: 8px;
}

.sev-info::before {
    content: 'ℹ️ ';
    margin-right: 8px;
}

/* URL Lists */
.urls {
    list-style: none;
    margin: 20px 0;
    padding: 0;
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.urls>li {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    padding: 0;
}

.urls>li>div.matched-in {
  text-align: right;
  font-size: smaller;
}

.urls li:last-child {
    border-bottom: none;
}

.urls li:hover {
    background: #f0f7ff;
    transform: translateX(4px);
}

.urls li a {
    display: block;
    padding: 20px 24px;
    text-decoration: none;
    color: #1e40af;
    font-weight: 600;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.urls li a:hover {
    color: #667eea;
}

.urls .subtype {
    display: inline-block;
    float: left;
    margin-top: 6px;
    margin-right: 8px;
    padding: 4px 10px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.urls .description {
    display: block;
    margin-top: 10px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 400;
}

/* Missing result section */
.result-section.missing {
    opacity: 0.7;
}

.result-section.missing > h3 {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
}

.result-section.missing p {
    color: #6b7280;
    font-style: italic;
}

/* Core Web Vitals Specific Styles */

/* Two-column grid for CWV sections */
.cwv-metrics-grid,
.cwv-screenshots-grid,
.cwv-scores-grid {
    display: flex;
    gap: 24px;
    margin: 20px 28px;
}

.cwv-column {
    flex: 1;
}

.cwv-column h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
    text-align: center;
}

/* Metric display */
.cwv-metric {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cwv-metric-name {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #64748b;
}

.cwv-metric-value {
    font-weight: 700;
    font-size: 14px;
}

/* Color classes based on score */
.cwv-score-good {
    color: #10b981;
}

.cwv-score-average {
    color: #eab308;
}

.cwv-score-poor {
    color: #ef4444;
}

/* Screenshot styling */
.cwv-screenshots-grid img {
    max-height: 75%;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Pie chart for PageSpeed scores */
.cwv-pie-chart {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto;
    background: conic-gradient(
        #6366f1 0deg,
        #6366f1 var(--score-angle, 0deg),
        #e5e7eb var(--score-angle, 0deg),
        #e5e7eb 360deg
    );
    position: relative;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.cwv-pie-chart::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.cwv-pie-chart::after {
    content: attr(data-score);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: #6366f1;
    font-weight: 800;
    font-size: 24px;
}

.cwv-pie-chart-container {
    text-align: center;
}

.cwv-pie-chart-container h6 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        border-radius: 12px;
    }

    #site-header {
        padding: 24px 20px;
    }

    .main-content {
        padding: 24px 20px;
    }

    .score-container {
        padding: 24px 20px;
    }

    #site-header h1 {
        font-size: 24px;
    }

    .site-domain {
        font-size: 18px;
    }

    /* CWV responsive */
    .cwv-metrics-grid,
    .cwv-screenshots-grid,
    .cwv-scores-grid {
        flex-direction: column;
        margin: 20px 20px;
    }
}
