/* Text Density Checker - Styles */

/* Variables */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-md: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    color: var(--gray-100);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--gray-400);
    font-size: 1.1rem;
}

/* Main */
main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards */
.card {
    background: var(--gray-800);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--white);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--gray-600);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-900);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--gray-300);
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 8px;
}

/* Preview Container */
.preview-container {
    margin-top: 20px;
}

.preview-container.hidden {
    display: none;
}

.preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    display: block;
    margin: 0 auto;
}

.preview-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
    font-size: 0.875rem;
    color: var(--gray-400);
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-700);
    color: var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-600);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-700);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
#results-section.hidden {
    display: none;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-btn {
    padding: 8px 16px;
    background: var(--gray-700);
    border: none;
    border-radius: var(--radius);
    color: var(--gray-300);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
}

.tab-content {
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 12px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane img {
    width: 100%;
    border-radius: var(--radius);
}

/* Metrics */
.result-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.metric-card {
    background: var(--gray-900);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
}

.metric-card.verdict {
    grid-column: span 2;
    padding: 24px;
}

.metric-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.metric-card.verdict .metric-value {
    font-size: 2rem;
}

/* Verdict Colors */
.verdict-green .metric-value {
    color: var(--success);
}

.verdict-yellow .metric-value {
    color: var(--warning);
}

.verdict-orange .metric-value {
    color: #f97316;
}

.verdict-red .metric-value {
    color: var(--danger);
}

/* Recommendations */
.recommendations {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-900);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.recommendations h3 {
    font-size: 1.1rem;
    color: var(--gray-100);
    margin-bottom: 16px;
}

.recommendations ul {
    list-style: none;
    padding: 0;
}

.recommendations li {
    padding: 8px 0;
    color: var(--gray-300);
    line-height: 1.6;
}

/* Scoring Details */
.scoring-details {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-700);
}

.scoring-details h3 {
    font-size: 1rem;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.detail-item {
    background: var(--gray-900);
    padding: 12px;
    border-radius: var(--radius);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: block;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--gray-200);
    font-weight: 500;
}

/* Boxes List */
.boxes-list {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-700);
}

.boxes-list h3 {
    font-size: 1rem;
    color: var(--gray-300);
    margin-bottom: 12px;
}

#boxes-container {
    max-height: 300px;
    overflow-y: auto;
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 12px;
}

.box-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--gray-800);
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.box-item:last-child {
    margin-bottom: 0;
}

.box-text {
    flex: 1;
    color: var(--gray-200);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.box-confidence {
    font-size: 0.75rem;
    color: var(--gray-500);
    padding: 2px 8px;
    background: var(--gray-700);
    border-radius: 4px;
}

/* History Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-700);
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-500);
}

.verdict-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.verdict-badge.verdict-green {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.verdict-badge.verdict-yellow {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.verdict-badge.verdict-orange {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.verdict-badge.verdict-red {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-small:hover {
    background: var(--primary-dark);
}
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: 600;
}

td {
    font-size: 0.9rem;
    color: var(--gray-300);
}

tr:hover td {
    background: var(--gray-700);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-yellow {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
}

.badge-red {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-900);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ============================================
   V2.0 NEW STYLES
   ============================================ */

/* Grid/Region Analysis */
.region-analysis {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-900);
    border-radius: var(--radius-md);
}

.region-analysis h3 {
    font-size: 1.1rem;
    color: var(--gray-100);
    margin-bottom: 16px;
}

.grid-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.grid-btn {
    padding: 8px 16px;
    background: var(--gray-700);
    border: none;
    border-radius: var(--radius);
    color: var(--gray-300);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.grid-btn.active {
    background: var(--primary);
    color: var(--white);
}

.grid-container {
    display: grid;
    gap: 4px;
    margin: 16px 0;
}

.grid-container.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-container.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--white);
    font-weight: 600;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.grid-cell:hover {
    transform: scale(1.05);
}

.grid-cell.empty {
    background: var(--gray-800);
    color: var(--gray-500);
}

.grid-cell.low {
    background: rgba(34, 197, 94, 0.3);
}

.grid-cell.medium {
    background: rgba(234, 179, 8, 0.5);
}

.grid-cell.high {
    background: rgba(249, 115, 22, 0.6);
}

.grid-cell.critical {
    background: rgba(239, 68, 68, 0.7);
}

.grid-cell-label {
    font-size: 0.65rem;
    opacity: 0.8;
    margin-bottom: 2px;
}

.grid-cell-percent {
    font-size: 0.9rem;
}

.region-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-item {
    background: var(--gray-800);
    padding: 12px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-200);
}

/* Reach Estimation */
.reach-estimation {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-900);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.reach-estimation h3 {
    font-size: 1.1rem;
    color: var(--gray-100);
    margin-bottom: 16px;
}

.reach-bar-container {
    margin: 16px 0;
}

.reach-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--gray-400);
}

.reach-bar {
    height: 24px;
    background: var(--gray-800);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.reach-bar-fill {
    height: 100%;
    border-radius: var(--radius);
    transition: width 0.5s ease;
}

.reach-bar-fill.excellent {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.reach-bar-fill.good {
    background: linear-gradient(90deg, #84cc16, #a3e635);
}

.reach-bar-fill.moderate {
    background: linear-gradient(90deg, #eab308, #facc15);
}

.reach-bar-fill.poor {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.reach-bar-fill.critical {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.reach-loss-text {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 12px;
}

.reach-loss-text.excellent { color: var(--success); }
.reach-loss-text.good { color: #84cc16; }
.reach-loss-text.moderate { color: var(--warning); }
.reach-loss-text.poor { color: #f97316; }
.reach-loss-text.critical { color: var(--danger); }

.reach-impact-level {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 8px;
}

.reach-impact-level.excellent {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.reach-impact-level.good {
    background: rgba(132, 204, 22, 0.2);
    color: #84cc16;
}

.reach-impact-level.moderate {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
}

.reach-impact-level.poor {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.reach-impact-level.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Comparison View */
.comparison-section {
    margin-top: 24px;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.comparison-header h3 {
    font-size: 1.25rem;
    color: var(--gray-100);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.comparison-item {
    background: var(--gray-900);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.comparison-item:hover {
    border-color: var(--gray-600);
}

.comparison-item.best {
    border-color: var(--success);
}

.comparison-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.comparison-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.comparison-metric {
    text-align: center;
    padding: 8px;
    background: var(--gray-800);
    border-radius: 4px;
}

.comparison-metric-label {
    font-size: 0.65rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

.comparison-metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-200);
}

.comparison-best-badge {
    display: inline-block;
    background: var(--success);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Face Detection */
.face-detection {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-900);
    border-radius: var(--radius-md);
    border-left: 4px solid #3b82f6;
}

.face-detection h3 {
    font-size: 1.1rem;
    color: var(--gray-100);
    margin-bottom: 16px;
}

.face-count-display {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.face-icon {
    font-size: 2.5rem;
}

.face-count-info {
    flex: 1;
}

.face-count-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-200);
}

.face-count-label {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.face-limit-warning {
    padding: 12px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: var(--radius);
    color: var(--warning);
    font-size: 0.875rem;
}

.face-limit-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* Contrast Analysis */
.contrast-analysis {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-900);
    border-radius: var(--radius-md);
    border-left: 4px solid #8b5cf6;
}

.contrast-analysis h3 {
    font-size: 1.1rem;
    color: var(--gray-100);
    margin-bottom: 16px;
}

.contrast-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.contrast-score {
    font-size: 2.5rem;
    font-weight: 700;
}

.contrast-score.excellent { color: var(--success); }
.contrast-score.good { color: #84cc16; }
.contrast-score.fair { color: var(--warning); }
.contrast-score.poor { color: #f97316; }
.contrast-score.very_poor { color: var(--danger); }

.contrast-rating-label {
    font-size: 1rem;
    color: var(--gray-300);
}

.wcag-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.wcag-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.wcag-badge.pass {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.wcag-badge.fail {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Export Section */
.export-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-900);
    border-radius: var(--radius-md);
}

.export-section h3 {
    font-size: 1.1rem;
    color: var(--gray-100);
    margin-bottom: 16px;
}

.export-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gray-700);
    color: var(--gray-200);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-export:hover {
    background: var(--gray-600);
}

.btn-export.pdf {
    background: #ef4444;
    color: white;
}

.btn-export.pdf:hover {
    background: #dc2626;
}

.btn-export.csv {
    background: #22c55e;
    color: white;
}

.btn-export.csv:hover {
    background: #16a34a;
}

/* Alerts */
.alerts-badge {
    position: relative;
}

.alerts-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.alert-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--gray-800);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-width: 350px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-toast.warning {
    border-left: 4px solid var(--warning);
}

.alert-toast.error {
    border-left: 4px solid var(--danger);
}

.alert-toast.info {
    border-left: 4px solid var(--primary);
}

.alert-toast.success {
    border-left: 4px solid var(--success);
}

.alert-toast-title {
    font-weight: 600;
    color: var(--gray-100);
    margin-bottom: 4px;
}

.alert-toast-message {
    font-size: 0.875rem;
    color: var(--gray-400);
}

/* Responsive */
@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .btn-export {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   V2.0 NEW STYLES
   ============================================ */

/* Reach Estimation */
.reach-estimation {
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.reach-estimation h3 {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.reach-bar-container {
    margin-bottom: 12px;
}

.reach-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--gray-300);
}

.reach-bar {
    height: 24px;
    background: var(--gray-700);
    border-radius: 12px;
    overflow: hidden;
}

.reach-bar-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease, background 0.3s ease;
    border-radius: 12px;
}

.reach-loss-text {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.9rem;
    margin: 12px 0;
}

.reach-impact-level {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Region Analysis */
.region-analysis {
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.region-analysis h3 {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.grid-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.grid-btn {
    padding: 8px 20px;
    border: 1px solid var(--gray-600);
    background: var(--gray-800);
    color: var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.grid-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.grid-container {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
}

.grid-container.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 80px);
}

.grid-container.grid-4x4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 60px);
}

.grid-cell {
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s;
}

.grid-cell:hover {
    transform: scale(1.05);
    z-index: 1;
}

.cell-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.cell-percent {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.region-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.region-stats .stat-item {
    background: var(--gray-800);
    padding: 12px;
    border-radius: var(--radius);
    text-align: center;
}

.region-stats .stat-item span:first-child {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 4px;
}

.region-stats .stat-item span:last-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

/* Face Detection */
.face-detection {
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.face-detection h3 {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.face-count-display {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.face-icon {
    font-size: 2.5rem;
}

.face-count-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
}

.face-count-label {
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* Contrast Analysis */
.contrast-analysis {
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.contrast-analysis h3 {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.contrast-rating {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.contrast-score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
}

.contrast-rating-label {
    font-size: 1.2rem;
    font-weight: 600;
}

.wcag-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wcag-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.wcag-badge.pass {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.wcag-badge.fail {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Comparison Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--gray-800);
    border-radius: var(--radius-md);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--white);
}

.modal-content h3 {
    color: var(--white);
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    color: var(--gray-300);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--gray-900);
    border: 1px solid var(--gray-600);
    border-radius: var(--radius);
    color: var(--white);
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Comparison Items */
.comparison-item {
    background: var(--gray-900);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.comparison-item:hover {
    background: var(--gray-700);
    transform: translateX(4px);
}

.comparison-item h4 {
    color: var(--white);
    margin-bottom: 4px;
}

.comparison-item p {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.comparison-header h2 {
    margin-bottom: 0;
}
