/* ===== Code Checker Module ===== */
.code-checker {
    padding: 20px 0 60px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.checker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 32px;
}

/* Language Selector */
.language-selector {
    margin-bottom: 24px;
}

.language-selector label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.language-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 48px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.lang-chip ion-icon {
    font-size: 18px;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.lang-chip:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.08);
    background: #fefefe;
}

.lang-chip.active {
    border-color: var(--lang-color, #3b82f6);
    background: color-mix(in srgb, var(--lang-color, #3b82f6) 6%, white);
    color: var(--lang-color, #2563eb);
    box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--lang-color, #3b82f6) 20%, transparent);
}

.lang-chip.active ion-icon {
    color: var(--lang-color, #3b82f6);
}

/* Editor Header */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    margin-top: 8px;
}

.editor-controls {
    display: flex;
    gap: 8px;
}

.editor-status {
    font-size: 0.75rem;
    color: #64748b;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* Buttons */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 40px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-sm:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.4);
}

.btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 48px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Code Input */
.code-input-wrapper {
    background: #0f172a;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-top: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.code-input {
    width: 100%;
    height: 420px;
    padding: 20px;
    font-family: 'Fira Code', 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    border: none;
    resize: vertical;
    background: #0f172a;
    color: #e2e8f0;
    outline: none;
    tab-size: 4;
    letter-spacing: -0.2px;
}

.code-input:focus {
    background: #1e293b;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.code-input::placeholder {
    color: #475569;
    font-style: italic;
}

.input-actions {
    margin-top: 20px;
}

/* Results Column */
.results-column {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: fit-content;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.results-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.results-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.code-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stat-badge {
    padding: 6px 16px;
    background: #f8fafc;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(4px);
}

.stat-badge.error-badge {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.stat-badge.warning-badge {
    background: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

/* Results Tabs */
.results-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.results-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.results-tab:hover {
    color: #3b82f6;
    background: #f8fafc;
}

.results-tab.active {
    color: #3b82f6;
    background: #eff6ff;
}

.results-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3b82f6;
    border-radius: 2px;
}

.results-pane {
    display: none;
    animation: fadeIn 0.25s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Code Preview */
.code-preview {
    padding: 20px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 480px;
    overflow-y: auto;
    position: relative;
}

.code-preview::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-preview::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 10px;
}

.code-preview::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

.code-preview::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Line Styles */
.code-line {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: pre-wrap;
    font-family: inherit;
    transition: background 0.1s ease;
}

.line-number {
    display: inline-block;
    width: 48px;
    padding-right: 16px;
    color: #475569;
    text-align: right;
    user-select: none;
    border-right: 1px solid #1e293b;
    margin-right: 16px;
    font-family: 'SF Mono', monospace;
    font-size: 12px;
}

.line-content {
    flex: 1;
    font-family: inherit;
    padding: 2px 0;
}

.line-content.error-line {
    background: rgba(239, 68, 68, 0.12);
    border-left: 3px solid #ef4444;
    padding-left: 10px;
    margin-left: -3px;
}

.line-content.warning-line {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    padding-left: 10px;
    margin-left: -3px;
}

/* Highlight Styles */
.error-highlight {
    background: rgba(239, 68, 68, 0.25);
    text-decoration: wavy underline #ef4444;
    text-decoration-skip-ink: none;
    border-radius: 3px;
    padding: 0 2px;
}

.warning-highlight {
    background: rgba(245, 158, 11, 0.2);
    text-decoration: wavy underline #f59e0b;
    text-decoration-skip-ink: none;
    border-radius: 3px;
    padding: 0 2px;
}

/* Errors List */
.errors-list {
    padding: 20px;
    background: #ffffff;
    max-height: 480px;
    overflow-y: auto;
}

.errors-list::-webkit-scrollbar {
    width: 6px;
}

.errors-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.errors-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.errors-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.error-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 14px;
    border-left: 4px solid transparent;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.error-item.error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.error-item.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

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

.error-line-badge {
    font-weight: 700;
    min-width: 70px;
    color: #475569;
    font-size: 0.85rem;
    font-family: 'SF Mono', monospace;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 30px;
    text-align: center;
}

.error-item.error .error-line-badge {
    background: #fee2e2;
    color: #b91c1c;
}

.error-item.warning .error-line-badge {
    background: #fef3c7;
    color: #b45309;
}

.error-message {
    flex: 1;
    color: #334155;
    line-height: 1.5;
}

.error-item.error .error-message {
    color: #991b1b;
}

.error-item.warning .error-message {
    color: #92400e;
}

.error-suggestion {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 500;
    letter-spacing: -0.2px;
}

/* Fixed Code */
.fixed-code-container {
    position: relative;
    padding: 20px;
    background: #0f172a;
    border-radius: 0 0 16px 16px;
}

.copy-btn {
    position: absolute;
    top: 32px;
    right: 32px;
    z-index: 10;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.8rem;
    backdrop-filter: blur(8px);
}

.copy-btn:hover {
    background: #334155;
    color: white;
    border-color: #475569;
}

.fixed-code-content {
    background: #0f172a;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e2e8f0;
    max-height: 440px;
    overflow-y: auto;
}

.fixed-code-content::-webkit-scrollbar {
    width: 8px;
}

.fixed-code-content::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 10px;
}

.fixed-code-content::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

/* Placeholder */
.code-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    color: #94a3b8;
    background: #f8fafc;
    border-radius: 12px;
    margin: 20px;
}

.code-placeholder ion-icon {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.code-placeholder p {
    font-size: 0.95rem;
    margin: 0;
}

/* Badges & Highlights */
.error-highlight, .warning-highlight {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 500;
}

.error-highlight {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.warning-highlight {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 8px;
    font-family: 'SF Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    box-shadow: 0 1px 0 #cbd5e1;
}

/* Animations */
.spin {
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 968px) {
    .checker-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .code-checker {
        padding: 16px 0 40px;
    }
    
    .language-chips {
        gap: 8px;
    }
    
    .lang-chip {
        padding: 8px 14px;
        font-size: 0.75rem;
    }
    
    .lang-chip ion-icon {
        font-size: 14px;
    }
    
    .code-input {
        height: 300px;
        font-size: 12px;
    }
    
    .code-stats {
        gap: 8px;
    }
    
    .stat-badge {
        padding: 4px 12px;
        font-size: 0.7rem;
    }
    
    .results-header h2 {
        font-size: 1.2rem;
    }
    
    .results-tab {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .error-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .error-line-badge {
        align-self: flex-start;
    }
}