/* Tool Specific Styles */
.tool-container {
    max-width: 1000px; /* Wider for comparison */
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Grid for Two Textareas */
.diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.code-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 16px;
    border: none;
    resize: vertical;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background-color: var(--bg-surface);
    color: var(--text-main);
    outline: none;
    line-height: 1.6;
}

textarea:focus { background-color: var(--bg-body); }

/* Comparison Output */
.diff-view {
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-wrap; /* Keeps formatting */
    word-break: break-word;
    min-height: 100px;
}

/* Diff Colors - Light Mode */
del {
    text-decoration: none;
    background-color: #fee2e2; /* Light Red */
    color: #991b1b;
    padding: 2px 4px;
    border-radius: 4px;
}

ins {
    text-decoration: none;
    background-color: #dcfce7; /* Light Green */
    color: #166534;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Diff Colors - Dark Mode Override */
body.dark-mode del {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

body.dark-mode ins {
    background-color: rgba(16, 185, 129, 0.2);
    color: #86efac;
}

/* Legend */
.legend {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background-color: #ef4444; }
.dot.green { background-color: #10b981; }

/* Buttons */
.controls-area {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.primary-btn {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s;
}

.primary-btn:active { transform: scale(0.98); }

.secondary-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
}

.secondary-btn:hover { border-color: #ef4444; color: #ef4444; }

/* Modal & Toast (Reused) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); transition: all 0.3s ease;
}
.modal-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.modal-content {
    background: var(--bg-surface); width: 90%; max-width: 400px;
    padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border-color);
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.modal-body p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 12px; }
.icon-button { background: none; border: none; padding: 6px; cursor: pointer; color: var(--text-muted); }

.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background-color: var(--accent-green); color: white; padding: 12px 24px;
    border-radius: 50px; font-weight: 600; font-size: 0.9rem;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 3000;
}
.toast.visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
    .diff-grid { grid-template-columns: 1fr; }
    textarea { height: 150px; }
}