* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --surface: #ffffff;
    --background: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.logo-text h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.logo-text p {
    color: var(--text-light);
    font-size: 14px;
}

.stats-bar {
    display: flex;
    gap: 32px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    flex: 1;
}

.editor-panel {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

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

.panel-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.editor-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.text-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
    border-radius: 12px;
    overflow: hidden;
}

#text-input {
    flex: 1;
    width: 100%;
    padding: 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.8;
    resize: none;
    font-family: 'Georgia', serif;
    color: var(--text);
}

#text-input:focus {
    outline: none;
}

#text-input::placeholder {
    color: var(--text-light);
    font-style: italic;
}

.editor-footer {
    padding: 16px 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 14px;
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.score-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.score-circle {
    width: 180px;
    height: 180px;
    margin: 0 auto 24px;
    position: relative;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.score-bg {
    stroke: var(--border);
}

.score-progress {
    stroke: var(--primary);
    stroke-dasharray: 440;
    stroke-dashoffset: calc(440 - (440 * var(--score, 0)) / 100);
    transition: stroke-dashoffset 0.5s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 14px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.bias-types {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.bias-types h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.bias-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.legend-item:hover {
    background: var(--background);
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-text {
    font-size: 14px;
    color: var(--text);
}

.legend-count {
    margin-left: auto;
    font-weight: 600;
    color: var(--primary);
}

.suggestions-panel {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    flex: 1;
}

.suggestions-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

#suggestions-container {
    max-height: 300px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.suggestion-item {
    background: var(--background);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
    transition: transform 0.2s;
}

.suggestion-item:hover {
    transform: translateX(4px);
}

.suggestion-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.5;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.suggestion-replace {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.suggestion-replace:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.bias-highlight {
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-weight: 500;
}

.bias-highlight:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bias-highlight::after {
    content: '🛈';
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
}

.bias-tooltip {
    position: absolute;
    background: var(--surface);
    color: var(--text);
    padding: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 300px;
    font-size: 14px;
    display: none;
}

.bias-tooltip.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.footer {
    text-align: center;
    padding: 24px;
    color: white;
    font-size: 14px;
    opacity: 0.9;
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        display: none;
    }
}
