/* --- UI RECOVERY: PREMIUM WORKSPACE --- */

/* Force Dark Mode Colors */
#workspace-root {
    background-color: #020617; /* Matches --bg-app */
    color: #94A3B8;
    min-height: 100vh;
}

/* Fix Radio Button Layout (Vertical Stack) */
.radio-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #94A3B8;
}

/* Custom Radio Appearance */
.radio-item input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    cursor: pointer;
    position: relative;
    outline: none;
}

.radio-item input[type="radio"]:checked {
    border-color: #14B8A6;
}

.radio-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #14B8A6;
    border-radius: 50%;
    box-shadow: 0 0 8px #14B8A6;
}

/* Reset the "Run Cleanup" Button from the White Box in your screenshot */
.btn-primary-action {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #0061FF, #004ecc);
    color: #fff !important;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 97, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-primary-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 25px rgba(0, 97, 255, 0.5);
}

/* Panels Depth */
.panel-group { 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(10px); 
    border: 1px solid var(--border-subtle); 
    padding: 24px; 
    border-radius: 16px; 
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}
.panel-label { 
    display: block; 
    font-size: 0.65rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 0.12em; 
    color: var(--color-teal); 
    margin-bottom: 20px; /* Space below the title */
    opacity: 0.8;
}
/* --- UI RECOVERY: PREMIUM WORKSPACE REFINEMENT --- */

/* Fix the Efficiency Metrics Header color and spacing */
.metrics-header {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}

.metrics-header span {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #14B8A6; /* Explicit Brand Teal */
    opacity: 1;
}

/* Standardize Analytics Row Spacing */
.panel-group .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0; /* Consistent breathing room */
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Remove the "ghost line" after Cleaned Words */
.panel-group .stat-row:last-child,
.panel-group .stat-row.no-border {
    border-bottom: none !important;
}
/* Clean Editor Typography */
.premium-textarea {
    background: transparent;
    border: none;
    color: #F8FAFC;
    width: 100%;
    min-height: 200px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
    padding: 20px;
}

/* --- EDITOR PANELS & HEADERS --- */
.editor-wrapper { 
    background: #0F172A; 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 16px; 
    overflow: hidden;
    margin-bottom: 0;
}

.editor-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.editor-header span {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-teal); /* Brand Teal to match sidebar labels */
    opacity: 0.8;
}

/* Ensure Cleaned Output remains distinct but consistent */
.editor-header span.text-teal {
    color: var(--color-teal);
    opacity: 1; /* Brighter for active output */
}
/* --- GLOWING EDITOR BUTTONS --- */
.editor-action-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #F8FAFC;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.editor-action-text:hover {
    background: rgba(0, 97, 255, 0.1);
    border-color: #0061FF;
    box-shadow: 0 0 12px rgba(0, 97, 255, 0.4);
    transform: translateY(-1px);
}

/* Success State for Copy Button */
.btn-success-glow {
    border-color: #14B8A6 !important;
    color: #14B8A6 !important;
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.4) !important;
}

/* --- OUTPUT STYLING --- */
.premium-output { 
    width: 100%; 
    min-height: 200px; 
    padding: 20px; 
    color: #94A3B8; 
    font-size: 1rem; 
    line-height: 1.6; 
    white-space: pre-wrap; 
}

.output-active { 
    border-color: #14B8A6 !important; 
}

.output-active .premium-output { 
    color: #5eead4; 
}

/* --- TRANSFORMATION ELEMENTS --- */
.transformation-divider { 
    display: flex; 
    align-items: center; 
    padding: 32px 0; 
}

.line { flex: 1; height: 1px; background: rgba(255, 255, 255, 0.08); }

.glow-arrow { 
    padding: 0 20px; 
    color: #14B8A6; 
    filter: drop-shadow(0 0 8px #14B8A6); 
}
/* --- Live Analytics Row Styling --- */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0; /* Vertical breathing room between rows */
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03); /* Subtle separator */
}
.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 4px; /* Space at the very bottom of the panel */
}
.stat-row span:first-child {
    opacity: 0.6;
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-teal);
}
#stat-count, 
#stat-chars {
    color: var(--color-teal);
    font-weight: 700;
    font-family: var(--font-mono);
    text-align: right;
}

#stat-chars {
    color: var(--text-bright); /* Keeping characters white for visual hierarchy */
}
/* --- Removed Artifacts Log --- */
.removed-log-container {
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 5px;
}

/* Custom Scrollbar for the Log */
.removed-log-container::-webkit-scrollbar { width: 4px; }
.removed-log-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

/* --- Removed Artifacts Log (Refined) --- */
.removed-tag {
    background: rgba(252, 165, 165, 0.1); 
    border: 1px solid rgba(252, 165, 165, 0.2);
    color: #fca5a5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    white-space: nowrap;
    text-decoration: none; /* Removed the line-through stroke */
}
/* Style for simplified phrase tags (e.g., utilize -> use) */
.removed-tag.simplified-tag {
    background: rgba(0, 97, 255, 0.1);
    border-color: rgba(0, 97, 255, 0.3);
    color: #60a5fa; /* Soft blue */
}

/* Ensure the log container scrolls nicely */
.removed-log-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
}
/* Ensure Output respects newlines */
.premium-output {
    white-space: pre-wrap; /* Crucial for paragraph preservation */
    word-wrap: break-word;
}
.heatmap-panel {
    margin-top: 25px; /* Adds space above heatmap now that it is under Input box */
    margin-bottom: 20px;
    border-color: rgba(20, 184, 166, 0.2);
}

.heatmap-display {
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    padding: 18px;
    line-height: 1.6;
    color: #94A3B8;
}

mark.fluff-highlight {
    background: rgba(20, 184, 166, 0.2);
    color: #14B8A6;
    border-bottom: 1px dashed rgba(20, 184, 166, 0.5);
    padding: 0 2px;
}
.heatmap-panel {
    margin-top: 25px; /* Adds the requested space above it */
    border-color: rgba(20, 184, 166, 0.2);
}
/* Ensure the output area looks like a "result" */
.premium-output {
    background: rgba(20, 184, 166, 0.05) !important; /* Subtle Teal Tint */
    border: 1px dashed rgba(20, 184, 166, 0.3) !important;
    color: #F8FAFC;
    cursor: default;
}

/* Activation glow for the output wrapper */
.output-active {
    box-shadow: 0 0 40px rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.4) !important;
    transition: all 0.4s ease;
}

/* Style for the repair log tags */
.repaired-tag {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(20, 184, 166, 0.1);
    color: #14B8A6;
    border-radius: 4px;
    font-size: 0.7rem;
    margin: 2px;
    border: 1px solid rgba(20, 184, 166, 0.2);
}
/* Stack checkboxes vertically */
.control-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* Ensure each toggle takes up its own line */
.toggle-control {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #94A3B8; /* Slate color to match brand */
    transition: color 0.2s ease;
}

.toggle-control:hover {
    color: #F8FAFC; /* Brighten on hover */
}

/* Add space between checkbox and text */
.toggle-control input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #14B8A6; /* Use AIFixKit Teal */
    width: 16px;
    height: 16px;
}
.app-faq-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 80px;
    padding-bottom: 100px;
}

.app-card {
    background: rgba(30, 41, 59, 0.3); /* Match your sidebar panels */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.faq-question {
    font-size: 1rem;
    font-weight: 600;
    color: #F8FAFC;
    margin-bottom: 12px;
}

.faq-answer {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #94A3B8;
}

.related-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.related-list li {
    margin-bottom: 12px;
}

.related-list a {
    color: #14B8A6;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.related-list a:hover {
    color: #0061FF;
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .app-faq-grid { grid-template-columns: 1fr; }
}
/* --- RESPONSIVE WORKSPACE LAYOUT --- */

/* 1. Default for Mobile: Stacked to prevent squashing */
.app-container { 
    display: flex;
    flex-direction: column;
    gap: 32px; 
    margin-top: 48px; 
    width: 100%;
}

/* 2. Desktop Only: Side-by-Side */
@media (min-width: 1024px) {
    .app-container { 
        display: grid !important; 
        grid-template-columns: 300px 1fr !important; 
        gap: 40px; 
        align-items: start;
    }

    .app-sidebar { 
        position: sticky; 
        top: 100px; 
    }
}

/* 3. Global Sidebar reset for mobile */
.app-sidebar { 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
}
/* Sidebar Panels */
.panel-group {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.panel-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #14B8A6; /* Accent Teal */
    margin-bottom: 16px;
    display: block;
}

/* Stats Styling */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: #94A3B8;
}

.stat-value {
    color: #F8FAFC;
    font-weight: 600;
}

/* Primary Fix Button */
.btn-primary-action {
    width: 100%;
    padding: 16px;
    background: #0061FF; /* AIFixKit Blue */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-primary-action:hover {
    transform: translateY(-2px);
    background: #0056e0;
}

/* Transformation Divider (The Glow Arrow) */
.transformation-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 32px 0;
}

.transformation-divider .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0), rgba(20, 184, 166, 0.3), rgba(20, 184, 166, 0));
}

.glow-arrow {
    color: #14B8A6;
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
    font-size: 1.2rem;
}

/* Ensure the sidebar panels have their dark card look */
#workspace-root .panel-group {
    background: rgba(30, 41, 59, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.input-group-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #94A3B8;
}

.input-group-row input {
    width: 60px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 4px;
    padding: 4px 8px;
    text-align: center;
}

.btn-secondary-action {
    width: 100%;
    padding: 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}