/* Controls row for test controls */
.controls-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: flex-end;
    margin-top: 8px;
    justify-content: flex-start;
}
.control-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    flex-shrink: 0;
}
.small-select {
    font-size: 0.9rem;
    padding: 6px 12px;
    min-width: 140px;
    max-width: 180px;
}
.small-input {
    font-size: 0.9rem;
    padding: 6px 12px;
    width: 80px;
    min-width: 80px;
}
.small-button {
    font-size: 0.9rem;
    padding: 8px 16px;
    min-width: 100px;
    max-width: 140px;
    height: 36px;
    align-self: flex-end;
    margin-top: auto;
    white-space: nowrap;
    background: #BF5A1F;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.small-button:hover {
    background: #A6501A;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(191, 90, 31, 0.3);
}

/* Media query para pantallas pequeñas - permitir wrap en móviles */
@media (max-width: 600px) {
    .controls-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .control-group {
        min-width: auto;
        flex: 1 1 auto;
    }
    .small-select {
        min-width: 120px;
    }
}

/* Footer styles */
.footer {
    background: #222;
    color: #fff;
    padding: 24px 0 16px 0;
    text-align: center;
    font-size: 1rem;
    margin-top: 48px;
}
.footer-link {
    color: #fff !important;
    text-decoration: underline;
    margin: 0 16px;
    transition: color 0.2s;
}
.footer-link:hover {
    color: #ffd700 !important;
}
/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B35;
    --secondary-color: #004E89;
    --accent-color: #00A6A6;
    --success-color: #2ECC71;
    --warning-color: #F39C12;
    --danger-color: #E74C3C;
    --light-bg: #F8F9FA;
    --white: #FFFFFF;
    --dark-text: #2C3E50;
    --light-text: #7F8C8D;
    --border-color: #E1E8ED;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --border-radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background: linear-gradient(135deg, var(--light-bg) 0%, #E8F4FD 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(-45deg, #F2DFBB, #F2A649, #BF5A1F, #F2A649);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
    color: var(--white);
    padding: 1.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.2;
}

header .container {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0;
    font-weight: 400;
}

.language-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.translate-btn, .language-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.translate-btn:hover, .language-select:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.language-select option {
    background: var(--secondary-color);
    color: var(--white);
}

/* Main content */
main {
    padding: 3rem 0;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    text-align: center;
}

/* Intro section */
.intro-section {
    text-align: center;
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.intro-section p {
    font-size: 1.2rem;
    color: var(--light-text);
    max-width: 800px;
    margin: 0 auto;
}

/* Test scenarios */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.scenario-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.scenario-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.scenario-dev {
    border-left: 4px solid var(--warning-color);
}

.scenario-custom-no-cache {
    border-left: 4px solid var(--accent-color);
}

.scenario-custom-cache {
    border-left: 4px solid var(--success-color);
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.scenario-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.not-recommended {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.recommended {
    background: rgba(0, 166, 166, 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.best {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.scenario-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.feature-tag {
    background: var(--light-bg);
    color: var(--dark-text);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Test controls */
.control-panel {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.control-panel h2 {
    text-align: left;
    margin-bottom: 2rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 2rem;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--dark-text);
}

.control-select, .control-input {
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    background: var(--white);
    transition: var(--transition);
    width: 100%;
}

.control-select:focus, .control-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.test-button {
    background: #BF5A1F;
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-small);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.test-button:hover {
    background: #A6501A;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.test-button:active {
    transform: translateY(0);
}

.test-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results section */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    color: var(--light-text);
    font-size: 1.1rem;
}

.result-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    /* Removed max-height and overflow-y to prevent double scroll */
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Disable hover effects during active testing to prevent flickering */
.result-card.testing {
    transition: none !important;
}

.result-card.testing:hover {
    transform: none !important;
    box-shadow: var(--shadow) !important;
}

/* Smooth transitions for reordering when not testing */
.result-card:not(.testing) {
    transition: var(--transition), transform 0.3s ease;
}

/* Region performance colors - background based */
.region-fastest {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08) 0%, rgba(39, 174, 96, 0.03) 100%) !important;
    border: 1px solid rgba(39, 174, 96, 0.2) !important;
}

.region-fast {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.03) 100%) !important;
    border: 1px solid rgba(46, 204, 113, 0.2) !important;
}

.region-medium {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.08) 0%, rgba(243, 156, 18, 0.03) 100%) !important;
    border: 1px solid rgba(243, 156, 18, 0.2) !important;
}

.region-slow {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.08) 0%, rgba(230, 126, 34, 0.03) 100%) !important;
    border: 1px solid rgba(230, 126, 34, 0.2) !important;
}

.region-slowest {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08) 0%, rgba(231, 76, 60, 0.03) 100%) !important;
    border: 1px solid rgba(231, 76, 60, 0.2) !important;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.result-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-text);
    flex: 1;
    min-width: 140px;
}

.result-summary {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: center;
}

.latency-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    background: var(--light-bg);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.latency-current, .latency-average {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
}

.test-progress {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.test-progress small {
    color: var(--light-text);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    display: block;
}

.progress-bar {
    background: var(--light-bg);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 0.4rem 0 0.2rem 0;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
    background: linear-gradient(90deg, 
        #22c55e 0%,   /* Green start */
        #3b82f6 25%,  /* Blue */
        #8b5cf6 50%,  /* Purple */
        #f59e0b 75%,  /* Orange */
        #ef4444 100%  /* Red end */
    );
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 3px;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--light-text);
    margin-top: 0.2rem;
}

.progress-count {
    font-weight: 500;
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary-color);
}

.latency-chart-container {
    margin: 0.5rem 0 !important;
    height: 40px !important;
    position: relative !important;
    background: rgba(255,255,255,0.5) !important;
    border-radius: 4px !important;
    padding: 2px !important;
    border: 1px solid rgba(0,0,0,0.1);
    overflow: hidden;
}

.latency-chart-container canvas {
    width: 100% !important;
    height: 36px !important;
}

/* Comparative Chart Styles */
.comparative-chart-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--light-border);
}

.chart-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.chart-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.download-button {
    background: var(--primary-color);
    color: white;
}

.download-button:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.twitter-button {
    background: #1da1f2;
    color: white;
}

.twitter-button:hover {
    background: #1a91da;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(29, 161, 242, 0.3);
}

.chart-header h3 {
    color: var(--dark-text);
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.chart-header p {
    color: var(--light-text);
    font-size: 0.9rem;
    margin: 0;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.02) 0%, 
        rgba(139, 92, 246, 0.02) 50%, 
        rgba(34, 197, 94, 0.02) 100%
    );
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
}

.chart-container canvas {
    border-radius: 4px;
}

/* Chart legends and labels */
.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--light-text);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .comparative-chart-section {
        margin: 1rem;
        padding: 1rem;
    }
    
    .chart-container {
        height: 250px;
        padding: 0.5rem;
    }
    
    .chart-header h3 {
        font-size: 1.2rem;
    }
    
    .chart-title-row {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }
    
    .chart-actions {
        justify-content: center;
    }
    
    .action-button {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

.test-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    gap: 0.3rem;
    max-height: 200px;
    overflow-y: auto;
    scroll-behavior: smooth;
    flex: 1;
    min-height: 120px;
}

.test-ping {
    background: var(--light-bg);
    padding: 0.4rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-height: 60px;
    justify-content: center;
}

.ping-success {
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 8px;
}

.ping-error {
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.05);
    border-radius: 8px;
}

/* Ping performance colors - subtle background gradients */
.test-ping.ping-excellent {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.12) 0%, rgba(39, 174, 96, 0.05) 100%) !important;
    border: 1px solid rgba(39, 174, 96, 0.3) !important;
}

.test-ping.ping-good {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.12) 0%, rgba(46, 204, 113, 0.05) 100%) !important;
    border: 1px solid rgba(46, 204, 113, 0.3) !important;
}

.test-ping.ping-fair {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.12) 0%, rgba(243, 156, 18, 0.05) 100%) !important;
    border: 1px solid rgba(243, 156, 18, 0.3) !important;
}

.test-ping.ping-poor {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.12) 0%, rgba(230, 126, 34, 0.05) 100%) !important;
    border: 1px solid rgba(230, 126, 34, 0.3) !important;
}

.test-ping.ping-slow {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.12) 0%, rgba(231, 76, 60, 0.05) 100%) !important;
    border: 1px solid rgba(231, 76, 60, 0.3) !important;
}

.ping-number {
    font-weight: bold;
    font-size: 0.65rem;
    color: var(--light-text);
}

.ping-latency {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 0.85rem;
}

.latency-stats {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--light-text);
}

/* Region info */
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.region-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    max-height: 400px;
    overflow-y: auto;
}

.region-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.region-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.region-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    text-align: left;
}

.region-details p {
    flex: 1 1 100%;
    margin-bottom: 8px;
}

.region-details code {
    background: var(--light-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary-color);
    word-break: break-all;
}

/* Footer */
footer {
    background: var(--dark-text);
    color: var(--white);
    text-align: var(--center);
    padding: 2rem 0;
    margin-top: 4rem;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

footer .language-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

footer .translate-btn, footer .language-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

footer .translate-btn:hover, footer .language-select:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

footer .language-select option {
    background: var(--dark-text);
    color: var(--white);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-hover);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .scenario-grid {
        grid-template-columns: 1fr;
    }
    
    .results-container {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .result-card {
        padding: 1rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-title {
        font-size: 0.95rem;
    }
    
    .result-summary {
        gap: 0.5rem;
    }
    
    .latency-display {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .test-details {
        grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
        gap: 0.25rem;
    }
    
    .test-ping {
        min-height: 55px;
        padding: 0.3rem;
        font-size: 0.7rem;
    }
    
    .language-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    section {
        margin-bottom: 2rem;
    }
    
    .control-panel, .intro-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .test-details {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .region-grid {
        grid-template-columns: 1fr;
    }
    
    .scenario-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
button:focus, select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .loading-overlay, .test-button, .language-selector {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .scenario-card, .region-card, .control-panel {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

.region-button {
    font-size: 0.8rem;
    padding: 6px 12px;
    min-width: 100px;
    max-width: 140px;
    height: 32px;
    background: #BF5A1F;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;
    display: inline-block;
    white-space: nowrap;
}

.region-button:hover {
    background: #A6501A;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(191, 90, 31, 0.3);
}

.region-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    text-align: left;
}

.region-details p {
    flex: 1 1 100%;
    margin-bottom: 8px;
}
