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

/* Toolbar */
.toolbar-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: center;
}

.toggle-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Checkbox Style */
.toggle-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

/* Grid Layout */
.text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.text-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 500px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.output-mode {
    border-color: var(--primary-blue);
    background-color: rgba(59, 130, 246, 0.02);
}

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

.header-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-count {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.badge-count.unique {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

/* Textareas */
textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    padding: 16px;
    background: transparent;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    outline: none;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Action Bars */
.action-bar {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-body);
    align-items: center;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}

.text-btn:hover { color: var(--primary-blue); }

.icon-btn-text {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.icon-btn-text:hover { opacity: 0.9; }

.stats-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: auto; /* Push buttons to right */
}

/* Middle Process Button */
.process-action {
    display: none; /* Hidden on Desktop, grid handles layout */
    text-align: center;
}

.primary-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* Modal & Toast (Standard) */
.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) {
    .text-grid {
        grid-template-columns: 1fr;
    }
    
    .process-action {
        display: block;
    }

    .text-card {
        height: 300px;
    }
}