/* CSS Variables for Light/Dark Theme Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --card-bg: #374151;
        --border-color: #4b5563;
        --primary-color: #8b5cf6;
        --primary-dark: #7c3aed;
        --accent-color: #10b981;
        --success-color: #059669;
        --tips-bg: #1f2937;
    }
}

/* Problem Keys Section */
.problem-keys-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .problem-keys-section {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

.problem-keys-section .section-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.problem-keys-section .section-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.problem-keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    max-width: 100%;
}

.problem-key-card {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .problem-key-card {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

.problem-key-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    transition: all 0.3s ease;
}

.problem-key-card.severity-high::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.problem-key-card.severity-medium::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.problem-key-card.severity-low::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.problem-key-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
    .problem-key-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
}

.key-display {
    margin-bottom: 12px;
}

.key-char {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .key-char {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    }
}

.error-info {
    margin-bottom: 10px;
}

.error-rate {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.error-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-indicator {
    margin-top: 8px;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-badge.high {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    border: 1px solid #fecaca;
}

@media (prefers-color-scheme: dark) {
    .difficulty-badge.high {
        background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 0.1));
        color: #fca5a5;
        border: 1px solid rgba(220, 38, 38, 0.3);
    }
}

.difficulty-badge.medium {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #d97706;
    border: 1px solid #fed7aa;
}

@media (prefers-color-scheme: dark) {
    .difficulty-badge.medium {
        background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(217, 119, 6, 0.1));
        color: #fcd34d;
        border: 1px solid rgba(217, 119, 6, 0.3);
    }
}

.difficulty-badge.low {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #059669;
    border: 1px solid #bbf7d0;
}

@media (prefers-color-scheme: dark) {
    .difficulty-badge.low {
        background: linear-gradient(135deg, rgba(5, 150, 105, 0.2), rgba(5, 150, 105, 0.1));
        color: #6ee7b7;
        border: 1px solid rgba(5, 150, 105, 0.3);
    }
}

.improvement-tip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .improvement-tip {
        background: var(--card-bg);
    }
}

.tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    color: var(--primary-color);
}

.tip-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    font-style: italic;
}

.no-problems {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 2px solid var(--success-color);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .no-problems {
        background: var(--card-bg);
    }
}

.success-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    color: var(--success-color);
}

.no-problems h3 {
    color: var(--success-color);
    font-size: 1.3rem;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.no-problems p {
    color: var(--text-muted);
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* Responsive design for problem keys */
@media (max-width: 768px) {
    .problem-keys-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .problem-key-card {
        padding: 10px;
    }
    
    .key-char {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 1.2rem;
    }
    
    .improvement-tip {
        padding: 10px 12px;
    }
    
    .tip-text {
        font-size: 0.85rem;
    }
}

/* Ensure typing interface is visible on user page */
#TypeWriter {
    display: block !important;
    margin-bottom: 24px;
}

#WriterSelector {
    display: block !important;
    margin-bottom: 24px;
}

#WORDBUTTON {
    display: block !important;
}

#optionsbox {
    display: block !important;
}

.oim {
    display: flex !important;
}

/* New User Onboarding Styles */
.new-user-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    position: relative;
}

/* Dark theme support for hero */
@media (prefers-color-scheme: dark) {
    .new-user-hero {
        background: linear-gradient(135deg, #4338ca 0%, #6b21a8 100%);
        box-shadow: 0 8px 32px rgba(67, 56, 202, 0.4);
    }
}

.new-user-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.new-user-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin: 0 0 32px 0;
    opacity: 0.95;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.95);
}

.hero-cta {
    margin-top: 32px;
}

.primary-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    text-decoration: none;
}

.cta-icon {
    font-size: 1.3rem;
}

/* Preview Section */
.preview-section {
    margin: 48px 0;
}

.preview-section h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--text-primary, #1f2937);
    margin: 0 0 32px 0;
    font-weight: 600;
}

/* Dark theme for preview section */
@media (prefers-color-scheme: dark) {
    .preview-section h2 {
        color: var(--text-primary, #f9fafb);
    }
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.preview-card {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Dark theme for preview cards */
@media (prefers-color-scheme: dark) {
    .preview-card {
        background: var(--card-bg, #374151);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        border-color: var(--border-color, #4b5563);
    }
}

.preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #4f46e5);
}

@media (prefers-color-scheme: dark) {
    .preview-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        border-color: var(--primary-color, #8b5cf6);
    }
}

.preview-card:hover::before {
    transform: scaleX(1);
}

.preview-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.8;
}

.preview-card h3 {
    color: var(--text-primary, #1f2937);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

@media (prefers-color-scheme: dark) {
    .preview-card h3 {
        color: var(--text-primary, #f9fafb);
    }
}

.preview-card p {
    color: var(--text-muted, #6b7280);
    line-height: 1.6;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .preview-card p {
        color: var(--text-muted, #d1d5db);
    }
}

/* Tips Section */
.tips-section {
    background: var(--tips-bg, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    padding: 40px 32px;
    margin: 48px 0;
}

@media (prefers-color-scheme: dark) {
    .tips-section {
        background: var(--tips-bg, #1f2937);
        border-color: var(--border-color, #374151);
    }
}

.tips-section h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--text-primary, #1f2937);
    margin: 0 0 32px 0;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .tips-section h2 {
        color: var(--text-primary, #f9fafb);
    }
}

.tips-list {
    max-width: 600px;
    margin: 0 auto;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .tip-item {
        background: var(--card-bg, #374151);
        border-color: var(--border-color, #4b5563);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

.tip-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
    .tip-item:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

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

.tip-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color, #4f46e5), #7c3aed);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

@media (prefers-color-scheme: dark) {
    .tip-number {
        background: linear-gradient(135deg, var(--primary-color, #8b5cf6), #a855f7);
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    }
}

.tip-content h4 {
    color: var(--text-primary, #1f2937);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

@media (prefers-color-scheme: dark) {
    .tip-content h4 {
        color: var(--text-primary, #f9fafb);
    }
}

.tip-content p {
    color: var(--text-muted, #6b7280);
    line-height: 1.6;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .tip-content p {
        color: var(--text-muted, #d1d5db);
    }
}

/* Responsive Design for New User Experience */
@media (max-width: 768px) {
    .new-user-hero {
        padding: 32px 20px;
        margin-bottom: 24px;
    }
    
    .new-user-hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .primary-cta {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .preview-card {
        padding: 24px 20px;
    }
    
    .tips-section {
        padding: 24px 20px;
    }
    
    .tip-item {
        gap: 16px;
        padding: 16px;
    }
    
    .tip-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* End New User Onboarding Styles */

/* End Problem Keys Section */

/* Progress Header */
.progress-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.progress-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.progress-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* Stats Grid Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Individual Stat Cards */
.stat-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card Types with Color Accents */
.stat-card.primary {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left: 4px solid #22c55e;
}

.stat-card.experience {
    border-left: 4px solid #8b5cf6;
}

.stat-card.accuracy {
    border-left: 4px solid #06b6d4;
}

.stat-card.characters {
    border-left: 4px solid #f59e0b;
}

.stat-card.streak {
    border-left: 4px solid #ef4444;
}

/* Stat Card Content */
.stat-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: block;
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 8px;
}

.stat-trend.positive {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.stat-trend.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Progress Sections */
.progress-section {
    margin-bottom: 40px;
}

.progress-section h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.progress-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Speed Journey */
.speed-journey {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px 30px 60px 30px;
    border: 1px solid var(--bg-secondary);
    position: relative;
}

.journey-track {
    background: var(--bg-secondary);
    height: 8px;
    border-radius: 4px;
    position: relative;
    margin-bottom: 40px;
}

.journey-progress {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.journey-milestones {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: -20px;
    padding: 0 10px;
}

.milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.milestone.achieved {
    opacity: 1;
}

.milestone-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.milestone.achieved .milestone-icon {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.milestone-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-position {
    position: absolute;
    top: 40px;
    transform: translateX(-50%);
}

.position-marker {
    font-size: 1.2rem;
    color: var(--primary-color);
    text-align: center;
}

.position-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin-top: 4px;
}

.journey-description {
    display: none;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.achievement {
    background: var(--bg-primary);
    border: 1px solid var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement.unlocked {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(247, 147, 30, 0.05), rgba(230, 126, 34, 0.05));
}

.achievement.locked {
    opacity: 0.4;
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.achievement-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.achievement-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.insight-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--bg-secondary);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.insight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.insight-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.insight-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.insight-content p:last-child {
    margin-bottom: 0;
}

/* Challenge Section */
.challenge-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 16px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.challenge-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.challenge-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: white;
}

.challenge-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    line-height: 1.5;
}

.challenge-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    background: white;
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.challenge-progress span {
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.challenge-button {
    background: white;
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: 8px;
}

.challenge-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Problem Keys Template Styles */
.problem-keys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.problem-key {
    background: var(--bg-primary);
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    font-family: monospace;
    font-weight: 600;
    color: #dc2626;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .problem-key {
        background: var(--card-bg);
        color: #fca5a5;
        border-color: #dc2626;
    }
}

.problem-key:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.05);
}

@media (prefers-color-scheme: dark) {
    .problem-key:hover {
        background: rgba(239, 68, 68, 0.2);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .progress-header h1 {
        font-size: 1.8rem;
    }
    
    .progress-subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .challenge-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
    
    .journey-milestones {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .speed-journey {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .progress-header {
        padding: 16px 0;
        margin-bottom: 24px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .progress-section {
        margin-bottom: 32px;
    }
    
    .insights-grid,
    .achievements-grid {
        gap: 12px;
    }
    
    .challenge-card {
        padding: 20px;
    }
}
