/* =========================================
   HOME (DIFF TOOL) SPECIFIC STYLES
   ========================================= */

#home {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 15px;
    position: relative;
}

/* --- 1. INPUT AREA --- */
.input-row {
    display: flex;
    gap: 20px;
    min-height: 150px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0; /* Prevent flex overflow */
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
    font-weight: bold;
}

.btn-clear {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    transition: 0.2s;
}
.btn-clear:hover { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; }

.input-row textarea {
    width: 100%;
    height: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    resize: vertical;
    overflow: auto; /* Independent scrolling */
    box-sizing: border-box;
}

.input-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* --- 2. ACTION BAR --- */
.action-bar-middle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: #162032;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
}

/* --- 3. RESULT AREA --- */
.result-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
}

.diff-toolbar {
    background: var(--bg-panel);
    padding: 8px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
}

.diff-stats {
    font-family: 'JetBrains Mono';
    font-size: 12px;
    color: var(--primary);
    font-weight: bold;
}

.nav-group, .merge-group { display: flex; gap: 8px; align-items: center; }

/* Merge Buttons */
.btn-merge {
    background: #334155;
    color: #fff;
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: 0.2s;
    display: none; /* Hidden by default */
}
.btn-merge:hover { background: var(--accent); border-color: var(--accent); }

.editor-box-large {
    flex-grow: 1;
    width: 100%;
    background: #1e1e1e;
}

/* --- 4. MODAL (Popup) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: popIn 0.2s ease-out;
}

.modal-box h3 { margin-top: 0; color: white; font-size: 18px; }
.modal-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

.modal-actions { display: flex; justify-content: center; gap: 15px; }

.btn-confirm { background: var(--success); color: white; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-confirm:hover { background: #059669; }

.btn-cancel { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 20px; border-radius: 6px; cursor: pointer; }
.btn-cancel:hover { color: white; border-color: white; }

@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Mobile */
@media (max-width: 768px) {
    .input-row { flex-direction: column; }
    .input-row textarea { height: 120px; }
    .diff-toolbar { flex-direction: column; gap: 10px; height: auto; padding: 10px; }
    .action-bar-middle { flex-direction: column; }
    .modal-box { width: 90%; }
}