/* Styles specific to the Simple Text Comparison (Diff Tool) */

.diff-container {
    max-width: 1200px; /* Allow wider container for side-by-side */
    margin: 1rem auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--preview-bg);
}

.diff-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    color: var(--text-color);
}

/* Input Area */
.text-input-area {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Allow stacking on small screens */
}

.textarea-wrapper {
    flex: 1; /* Each textarea wrapper takes half the space */
    min-width: 300px; /* Minimum width before stacking */
}

.textarea-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--label-text);
}

.textarea-wrapper textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; /* Monospace good for diff */
    font-size: 0.95rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    resize: vertical;
    min-height: 250px;
    transition: border-color 0.2s ease;
    line-height: 1.5;
}

.textarea-wrapper textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}
body.dark-mode .textarea-wrapper textarea:focus {
     box-shadow: 0 0 0 2px rgba(102, 191, 255, 0.25);
}

/* Controls Area */
.controls-area {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
     flex-wrap: wrap;
}

.control-button {
    padding: 0.7rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    background-color: var(--accent-color);
    color: var(--bg-color-light);
}
body.dark-mode .control-button {
    color: var(--bg-color-dark);
}
.control-button:hover {
    opacity: 0.9;
}

.options-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.options-area label {
    font-weight: 500;
    color: var(--label-text);
}

.options-area select {
     padding: 0.5rem 0.8rem;
     border: 1px solid var(--border-color);
     border-radius: 4px;
     font-size: 0.95rem;
     background-color: var(--bg-color);
     color: var(--text-color);
}

/* Output Area */
#output-container {
    margin-top: 2rem;
}
#output-container.hidden {
    display: none;
}

#output-container h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--text-color);
    text-align: center;
}

#diff-output {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap; /* Preserve whitespace and wrap lines */
    word-wrap: break-word;
    max-height: 60vh; /* Limit height */
    overflow-y: auto; /* Add scroll if needed */
}

/* Styling for diff elements */
#diff-output ins {
    background-color: rgba(40, 167, 69, 0.2); /* Light green */
    color: inherit; /* Use default text color */
    text-decoration: none; /* Remove underline */
    padding: 0.1em 0;
}
body.dark-mode #diff-output ins {
     background-color: rgba(40, 167, 69, 0.3); /* Slightly stronger green */
}

#diff-output del {
    background-color: rgba(220, 53, 69, 0.2); /* Light red */
    color: inherit; /* Use default text color */
    text-decoration: line-through;
     padding: 0.1em 0;
}
body.dark-mode #diff-output del {
     background-color: rgba(220, 53, 69, 0.3); /* Slightly stronger red */
}

#diff-output span {
    /* Style for common parts if needed, e.g., ensure no background */
}


/* Responsive */
@media (max-width: 768px) {
    .text-input-area {
        flex-direction: column; /* Stack text areas */
    }
    .diff-container {
         padding: 1rem;
    }
     .controls-area {
        flex-direction: column;
        gap: 1rem;
    }
}