/* Diff Checker Tool CSS */

.tool-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.tool-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 992px) {
    .tool-container {
        flex-direction: row;
    }
    
    .input-section,
    .output-section {
        flex: 1;
    }
}

.input-section, 
.output-section {
    margin-bottom: 2rem;
}

.form-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group.inline {
    display: inline-flex;
    align-items: center;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}

.form-group.inline label {
    margin-bottom: 0;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #343541;
    font-size: 1.05rem;
}

input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset;
}

select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    color: #343541;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23343541' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 1.2rem auto;
    padding-right: 2.5rem;
    background-color: white;
    min-width: 200px;
}

.options-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.checkbox-wrapper {
    background-color: white;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

#compare-btn {
    margin-top: 1rem;
}

#stats-container {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.95rem;
    color: #4b5563;
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: bold;
}

.stat-value.deleted {
    color: #e74c3c;
}

.stat-value.inserted {
    color: #2ecc71;
}

.diff-identical {
    text-align: center;
    padding: 0.5rem;
    background-color: #e8f5e9;
    color: #388e3c;
    font-weight: bold;
    border-radius: 4px;
}

#diff-result {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fff;
    overflow: auto;
    min-height: 300px;
    max-height: 600px;
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.diff-inline {
    padding: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.diff-line-by-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100%;
}

.diff-column {
    border-right: 1px solid #ddd;
}

.diff-column:last-child {
    border-right: none;
}

.diff-header {
    padding: 0.5rem 1rem;
    background-color: #f5f7fa;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
}

.diff-content {
    padding: 0.5rem 0;
}

.line {
    padding: 0 1rem;
    white-space: pre-wrap;
    position: relative;
}

.line.deleted {
    background-color: #ffebee;
}

.line.inserted {
    background-color: #e8f5e9;
}

.equal {
    color: #333;
}

.deleted {
    background-color: #ffebee;
    color: #c62828;
    text-decoration: line-through;
    padding: 0 2px;
}

.inserted {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 0 2px;
}

.identical-text {
    padding: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.placeholder {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
    font-size: 1rem;
}

.error {
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    margin-top: 2rem;
}