
/* Facebook-inspired design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.34;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.header {
    background: #ffffff;
    padding: 20px;
    margin: -20px -20px 20px -20px;
    border-radius: 0 0 8px 8px;
    color: #0D3B66;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #FFB703;
}

.header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
}

.logo-container {
    margin-bottom: 10px;
}

.header-logo {
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.last-updated {
    font-size: 0.9em;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9em;
    opacity: 0.8;
}

.breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li::marker {
    display: none;
}

.breadcrumb a {
    color: #0D3B66;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #FFB703;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.performance { border-left-color: #E07A00; }
.stat-card.accessibility { border-left-color: #1E6091; }
.stat-card.seo { border-left-color: #FFB703; }
.stat-card.best-practices { border-left-color: #081C34; }

.stat-card h3 {
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #65676b;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-trend {
    font-size: 0.85em;
    color: #65676b;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    min-width: 0;
}

.section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    min-height: auto;
    overflow: visible;
    min-width: 0;
}

.section h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1c1e21;
}

.country-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.best-country, .second-best-country, .second-worst-country, .worst-country {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
}

.best-country {
    background: linear-gradient(135deg, #FFB703 0%, #FFD166 100%);
    color: #081C34;
}

.second-best-country {
    background: linear-gradient(135deg, #1E6091 0%, #0D3B66 100%);
    color: white;
}

.second-worst-country {
    background: linear-gradient(135deg, #FFD166 0%, #E07A00 100%);
    color: #081C34;
}

.worst-country {
    background: linear-gradient(135deg, #0D3B66 0%, #081C34 100%);
    color: white;
}

.country-score {
    font-size: 2em;
    font-weight: 700;
    margin: 10px 0;
}

/* Website Comparison Styles */
.website-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.best-website {
    background: linear-gradient(135deg, #FFB703 0%, #FFD166 100%);
    color: #081C34;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
}

.worst-website {
    background: linear-gradient(135deg, #0D3B66 0%, #081C34 100%);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
}

.website-score {
    font-size: 2em;
    font-weight: 700;
    margin: 10px 0;
}

.website-tile-link {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.website-tile-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.website-tile-link:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.website-tile-link:active {
    transform: translateY(-1px);
}

/* Clickable country tile styles */
.country-tile-link {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.country-tile-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.country-tile-link:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.country-tile-link:active {
    transform: translateY(-1px);
}

.industry-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.best-industry, .worst-industry {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    min-width: 0;
    overflow-wrap: break-word;
}

.best-industry {
    background: linear-gradient(135deg, #FFB703 0%, #FFD166 100%);
    color: #081C34;
    border: 2px solid #E07A00;
}

.worst-industry {
    background: linear-gradient(135deg, #1E6091 0%, #0D3B66 100%);
    color: white;
    border: 2px solid #081C34;
}

.industry-score {
    font-size: 2em;
    font-weight: 700;
    margin: 10px 0;
}

.industry-rankings {
    margin-top: 20px;
    overflow: visible;
}

.industry-rankings h3 {
    margin-bottom: 15px;
    color: #1c1e21;
}

.industry-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.industry-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.industry-item:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateY(-2px);
    text-decoration: none !important;
}

.industry-rank {
    font-size: 1.2em;
    font-weight: 700;
    width: 40px;
    text-align: center;
    color: #1c1e21;
}

.industry-name {
    flex: 1;
    font-weight: 600;
    margin-left: 15px;
}

.industry-metrics {
    display: flex;
    gap: 10px;
}

.industry-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.industry-link:hover {
    text-decoration: underline;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.country-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none !important;
    color: #081C34;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #FFB703;
    position: relative;
    overflow: hidden;
}

.country-card:hover {
    box-shadow: 0 4px 12px rgba(13, 59, 102, 0.15);
    transform: translateY(-2px);
    text-decoration: none !important;
    color: #081C34 !important;
}

.country-rank {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FFB703 0%, #E07A00 100%);
    color: #081C34;
    font-size: 0.8em;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid #FFD166;
}

.country-flag {
    font-size: 2em;
    margin-bottom: 10px;
}

.country-card h3 {
    font-size: 1em;
    margin-bottom: 10px;
    font-weight: 600;
}

.country-metrics {
    display: flex;
    justify-content: space-around;
    font-size: 0.8em;
}

.metric {
    background: #e4e6ea;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.see-all-link {
    text-align: center;
    margin-top: 20px;
}

.btn-see-all {
    display: inline-block;
    background: linear-gradient(135deg, #0D3B66 0%, #42a5f5 100%);
    color: white !important;
    padding: 12px 24px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}

.btn-see-all:hover {
    background: linear-gradient(135deg, #166dd4 0%, #3a93d4 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.4);
    color: white !important;
    text-decoration: none;
}

.btn-see-all:visited,
.btn-see-all:link,
.btn-see-all:active {
    color: white !important;
    text-decoration: none;
}

.search-container {
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e4e6ea;
    border-radius: 24px;
    font-size: 1em;
    transition: border-color 0.2s;
    outline: none;
}

#searchInput:focus {
    border-color: #0D3B66;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.results-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    color: #65676b;
    border-bottom: 2px solid #e4e6ea;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.site-row:hover {
    background: #f8f9fa;
}

.rank {
    font-weight: 700;
    color: #0D3B66;
    width: 60px;
}

.domain-link {
    color: #0D3B66;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.domain-link:hover {
    color: #166fe5;
    text-decoration: underline;
}

/* Scan Type Badges and Row Styling */
.scan-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.scan-badge.latest {
    background: linear-gradient(135deg, #42b883 0%, #369870 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(66, 184, 131, 0.3);
}

.scan-badge.recent {
    background: linear-gradient(135deg, #0D3B66 0%, #166fe5 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(24, 119, 242, 0.3);
}

.latest-scan {
    background: rgba(66, 184, 131, 0.05);
    border-left: 3px solid #42b883;
}

.recent-scan {
    background: rgba(24, 119, 242, 0.05);
    border-left: 3px solid #0D3B66;
}

.latest-scan:hover {
    background: rgba(66, 184, 131, 0.1);
}

.recent-scan:hover {
    background: rgba(24, 119, 242, 0.1);
}

.scan-type {
    text-align: center;
    width: 80px;
}

.section-description {
    color: #65676b;
    font-size: 0.95em;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0D3B66;
}

.country-link {
    color: #65676b;
    text-decoration: none;
    transition: color 0.2s;
}

.country-link:hover:not(.country-card) {
    color: #0D3B66;
}

.score {
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    min-width: 60px;
}

.score.excellent { background: #d4edda; color: #155724; }
.score.good { background: #d1ecf1; color: #0c5460; }
.score.average { background: #fff3cd; color: #856404; }
.score.poor { background: #f8d7da; color: #721c24; }

.date {
    color: #65676b;
    font-size: 0.9em;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #65676b;
    font-size: 0.9em;
}

.footer p {
    margin: 5px 0;
}

.footer a {
    color: #0D3B66;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Domain page specific styles */
.domain-info {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
}

.country-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9em;
}

.last-scan {
    font-size: 0.9em;
    opacity: 0.8;
}

.stat-description {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 5px;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

.score-breakdown {
    display: grid;
    gap: 15px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-label {
    min-width: 120px;
    font-weight: 600;
}

.score-bar {
    flex: 1;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 15px;
    transition: width 0.3s ease;
    position: relative;
}

.score-fill.performance { background: linear-gradient(90deg, #E07A00, #FFB703); }
.score-fill.accessibility { background: linear-gradient(90deg, #4285f4, #34a853); }
.score-fill.best-practices { background: linear-gradient(90deg, #9c27b0, #673ab7); }
.score-fill.seo { background: linear-gradient(90deg, #34a853, #0f9d58); }
.score-fill.pwa { background: linear-gradient(90deg, #ff9800, #ff5722); }

.score-text {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.no-history {
    text-align: center;
    padding: 40px;
    color: #65676b;
}

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .industry-comparison {
        gap: 15px;
    }
    
    .country-grid {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .country-comparison {
        grid-template-columns: 1fr;
    }
    
    .website-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .industry-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .country-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .header {
        padding: 20px;
        margin: -20px -20px 20px -20px;
    }
    
    /* Hide rightmost industry metrics on smaller screens */
    .industry-metrics .metric:nth-child(4) {
        display: none; /* Hide "X sites" count first */
    }
}

@media (max-width: 640px) {
    /* Hide SEO metric next */
    .industry-metrics .metric:nth-child(3) {
        display: none;
    }
}

@media (max-width: 520px) {
    /* Hide Accessibility metric next */
    .industry-metrics .metric:nth-child(2) {
        display: none;
    }
}

@media (max-width: 400px) {
    /* On very small screens, hide all metrics, keep only industry name */
    .industry-metrics {
        display: none;
    }
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .results-table {
        font-size: 0.9em;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 6px;
    }
}

/* Trend arrows */
.trend-arrow {
    font-size: 0.9em;
    font-weight: bold;
    margin-left: 4px;
    display: inline-block;
    transform: translateY(-1px);
}

.trend-up {
    color: #42b883;
}

.trend-down {
    color: #e74c3c;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Skip Navigation Link */
/* Enhanced Focus Indicators */
*:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

button:focus, .btn:focus, input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Live Region for Dynamic Announcements */
.live-region {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Offline Badge */
.offline-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    z-index: 10000;
    animation: fadeInPulse 0.5s ease-in-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes fadeInPulse {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    50% {
        transform: translateY(0) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.offline-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

/* High Contrast Color Improvements for WCAG AA compliance */
.score.excellent, .perf-excellent, .acc-excellent, .seo-excellent, .bp-excellent, .pwa-excellent {
    background: #d1f2eb !important;
    color: #0f5132 !important;
    border: 1px solid #0f5132;
}

.score.good, .perf-good, .acc-good, .seo-good, .bp-good, .pwa-good {
    background: #fff3cd !important;
    color: #664d03 !important;
    border: 1px solid #664d03;
}

.score.average, .perf-average, .acc-average, .seo-average, .bp-average, .pwa-average {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #721c24;
}

.score.poor, .perf-poor, .acc-poor, .seo-poor, .bp-poor, .pwa-poor {
    background: #f5c2c7 !important;
    color: #721c24 !important;
    border: 1px solid #721c24;
}

/* Enhanced Table Accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: left;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #212529;
}

caption {
    padding: 12px;
    font-weight: bold;
    text-align: left;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-bottom: none;
    caption-side: top;
}

/* Enhanced Link Accessibility */
a {
    color: #0056b3;
    text-decoration: underline;
}

a:hover, a:focus {
    text-decoration: none;
}

/* Form Elements Accessibility */
input[type="text"], input[type="search"] {
    border: 2px solid #ced4da;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 16px;
}

input[type="text"]:focus, input[type="search"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Button Accessibility */
.btn-see-all {
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.btn-see-all:focus {
    border-color: #007bff;
    outline: none;
}

/* Country and Industry Rankings Accessibility */
.country-rank, .industry-rank {
    background: #0f4d8c !important;
    color: white !important;
    border: 1px solid #0a3566;
}

/* Enhanced Navigation */
.nav-links {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.nav-links li {
    display: inline-block;
    margin-right: 20px;
}

.nav-links a {
    color: #1e3a5f;
    text-decoration: underline;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a:focus {
    background: rgba(255, 183, 3, 0.1);
    color: #FFB703;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Advanced Table Sorting */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px !important;
    transition: background-color 0.2s ease;
}

.sortable-header:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.sortable-header:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

.sort-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sortable-header.sort-asc .sort-indicator::after {
    content: "▲";
    opacity: 1;
    color: #007bff;
}

.sortable-header.sort-desc .sort-indicator::after {
    content: "▼";
    opacity: 1;
    color: #007bff;
}

.sortable-header:not(.sort-asc):not(.sort-desc) .sort-indicator::after {
    content: "⇅";
}

.sortable-header:hover .sort-indicator {
    opacity: 1;
}

/* Enhanced Trend Arrows */
.trend-arrow {
    font-size: 0.9em;
    font-weight: bold;
    margin-left: 6px;
    display: inline-block;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

.trend-up {
    color: #28a745;
    animation: trendPulse 2s infinite;
}

.trend-down {
    color: #dc3545;
    animation: trendPulse 2s infinite;
}

.trend-same {
    color: #6c757d;
    opacity: 0.7;
}

@keyframes trendPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Performance Delta Badges */
.performance-delta {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
    display: inline-block;
}

.delta-positive {
    background: #d4edda;
    color: #155724;
}

.delta-negative {
    background: #f8d7da;
    color: #721c24;
}

.delta-neutral {
    background: #e2e3e5;
    color: #6c757d;
}

/* Advanced Sorting Controls */
.sorting-controls {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sorting-controls h4 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #ffffff;
    font-weight: 600;
}

.sort-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.sort-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.sort-btn.desc {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Table Row Highlighting for Trends */
.site-row.trending-up {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.05) 0%, transparent 100%);
}

.site-row.trending-down {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.05) 0%, transparent 100%);
}

/* Responsive Enhancements for Trends */
@media (max-width: 768px) {
    .trend-arrow {
        font-size: 0.8em;
        margin-left: 4px;
    }
    
    .performance-delta {
        font-size: 0.6em;
        padding: 1px 4px;
        margin-left: 4px;
    }
    
    .sorting-controls {
        padding: 10px;
    }
    
    .sort-buttons {
        gap: 6px;
    }
    
    .sort-btn {
        padding: 4px 8px;
        font-size: 0.75em;
    }
}

/* Status and Score Announcements */
.score[aria-label]::after {
    content: "";
}

/* Responsive Accessibility */
@media (max-width: 768px) {
    th, td {
        padding: 8px;
        font-size: 14px;
    }
    
    input[type="text"], input[type="search"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .score {
        border-width: 2px !important;
    }
    
    .btn-see-all {
        border-width: 3px !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   MODAL AND FORM STYLES
   ============================================ */

/* Suggest Button */
.suggest-btn {
    background: linear-gradient(135deg, #FFB703 0%, #E07A00 100%);
    color: #081C34;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9em;
}

.suggest-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 183, 3, 0.3);
    background: linear-gradient(135deg, #E07A00 0%, #FFB703 100%);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 2px solid #f0f2f5;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    color: #0D3B66;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #65676b;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f0f2f5;
    color: #0D3B66;
}

/* Form Styles */
#websiteForm {
    padding: 0 24px 24px 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #0D3B66;
    font-size: 0.9em;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e4e6ea;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0D3B66;
    box-shadow: 0 0 0 3px rgba(13, 59, 102, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #65676b;
    font-size: 0.8em;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e4e6ea;
}

.btn-cancel {
    background: #f8f9fa;
    color: #65676b;
    border: 2px solid #e4e6ea;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-submit {
    background: linear-gradient(135deg, #0D3B66 0%, #1E6091 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #081C34 0%, #0D3B66 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 59, 102, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Success/Error Messages */
.success-message,
.error-message {
    text-align: center;
    padding: 40px 24px;
}

.success-icon,
.error-icon {
    font-size: 3em;
    margin-bottom: 16px;
}

.success-message h3 {
    color: #28a745;
    margin: 0 0 12px 0;
}

.error-message h3 {
    color: #dc3545;
    margin: 0 0 12px 0;
}

.retry-btn {
    background: linear-gradient(135deg, #FFB703 0%, #E07A00 100%);
    color: #081C34;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 183, 3, 0.3);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        border-radius: 12px;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px 20px 0 20px;
    }
    
    #websiteForm {
        padding: 0 20px 20px 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-submit {
        width: 100%;
    }
}
