.tool-workspace {
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 75vh;
    padding-bottom: 2rem;
}

.tool-panel {
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.phase-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.phase-container.hidden {
    display: none;
}

/* Phase 1: Inputs */
.folder-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.folder-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.folder-box:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.folder-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.folder-file-input {
    display: none;
}

.folder-box label.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.folder-box label.btn:hover {
    transform: scale(1.2);
}

.selected-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-secondary);
    word-break: break-all;
    max-height: 80px;
    overflow: hidden;
}

.filter-section {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-section label {
    font-size: 0.95rem;
    font-weight: 500;
}

.filter-section input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.filter-section input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.action-bar {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.btn-large {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-charming-back {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-charming-back:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    color: white;
}

.how-to-use-container {
    position: absolute;
    top: -10px;
    right: 0;
    z-index: 10;
}
.how-to-use-trigger {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: help;
    font-size: 0.85rem;
    font-weight: 500;
}
.how-to-use-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 350px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    text-align: left;
}
.how-to-use-container:hover .how-to-use-content {
    display: block;
}

/* Phase 2: File List */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.summary-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.3);
}

.stat-badge.added span { color: #22c55e; }
.stat-badge.removed span { color: #ef4444; }
.stat-badge.modified span { color: #eab308; }
.stat-badge.unchanged span { color: var(--text-muted); }

.file-list-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.2s ease;
}

.file-item:hover {
    background: rgba(255,255,255,0.05);
}

.file-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.file-tag {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.tag-added { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.tag-removed { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.tag-modified { background: rgba(234, 179, 8, 0.2); color: #fde047; }

/* Phase 3: Diff Viewer */
.diff-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

#diff-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    margin: 0;
    flex-grow: 1;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.split-pane {
    display: flex;
    gap: 1rem;
    height: 700px;
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pane-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

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

/* Diff Styling (Same as diff-checker, with line numbers) */
.diff-view {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 0;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.diff-line {
    display: flex;
    min-height: 1.5em;
}

.line-num {
    display: inline-block;
    width: 3.5rem;
    min-width: 3.5rem;
    padding-right: 0.5rem;
    text-align: right;
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
    border-right: 1px solid var(--glass-border);
    margin-right: 1rem;
    background: rgba(0,0,0,0.2);
}

.line-text {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-removed {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-left: 2px solid #ef4444;
}

.diff-added {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border-left: 2px solid #22c55e;
}

.diff-unchanged {
    color: var(--text-muted);
    border-left: 2px solid transparent;
}

.diff-empty {
    background-color: rgba(0, 0, 0, 0.1);
    border-left: 2px solid transparent;
}

/* Fullscreen mode utility */
.tool-panel.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    z-index: 9999;
    border-radius: 0;
    background: var(--bg-gradient-start); /* Opaque background to hide the rest */
}
.tool-panel.fullscreen-mode .split-pane {
    height: calc(100vh - 120px);
}
