/* ==========================================================================
   FeieSoft - Tool Specific UI & Interactive Workspace (tools.css)
   ========================================================================== */

/* Main Workspace Card */
.tool-workspace {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    position: relative;
}

/* Toolbar Controls */
.tool-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.toolbar-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Primary, Secondary, and Ghost Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
}

.btn-primary {
    background: var(--brand-primary);
    color: #ffffff;
    border: 1px solid var(--brand-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--brand-rose);
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.2);
}

/* Split Pane Grid (Side by side on desktop, stacked on mobile) */
.split-pane-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 860px) {
    .split-pane-grid {
        grid-template-columns: 1fr;
    }
}

.pane-column {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pane-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Code & Text Area */
.tool-textarea {
    width: 100%;
    min-height: 380px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tool-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.tool-textarea[readonly] {
    background: var(--bg-surface-elevated);
    cursor: text;
}

/* Status Banner / Feedback Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.75rem;
    transition: all var(--transition-fast);
}

.status-bar.status-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--brand-emerald);
}

.status-bar.status-error {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--brand-rose);
}

.status-bar.status-info {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--brand-cyan);
}

/* Controls & Sliders Grid (for CSS Generators) */
.controls-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 960px) {
    .controls-layout {
        grid-template-columns: 1fr;
    }
}

.controls-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.control-val {
    font-family: var(--font-mono);
    font-size: 0.825rem;
    color: var(--brand-primary);
}

/* Range Inputs */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
    accent-color: var(--brand-primary);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border: 2px solid #ffffff;
}

/* Standard Form Inputs */
.form-input, .form-select {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Glassmorphism & Shadow Preview Canvas */
.preview-canvas-box {
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ec4899, #8b5cf6, #3b82f6);
}

.preview-target-card {
    width: 280px;
    padding: 2rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: #ffffff;
    transition: all 0.15s ease;
}

/* Diff Checker Layout */
.diff-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.diff-output-box {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    min-height: 280px;
    overflow-x: auto;
}

.diff-line {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

.diff-line.added {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.diff-line.removed {
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
}

.diff-line.unchanged {
    color: var(--text-dim);
}

/* SEO Meta Tag Previews (Google SERP Snippet & Social Cards) */
.serp-preview-box {
    background: #ffffff;
    color: #1f1f1f;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-family: Arial, sans-serif;
    margin-top: 1rem;
}

.serp-url {
    font-size: 0.85rem;
    color: #202124;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.serp-title {
    font-size: 1.25rem;
    color: #1a0dab;
    cursor: pointer;
    line-height: 1.3;
    margin-bottom: 0.35rem;
}

.serp-desc {
    font-size: 0.875rem;
    color: #4d5156;
    line-height: 1.5;
}

/* Social Card Preview */
.social-card-preview {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface-elevated);
    margin-top: 1rem;
}

.social-card-img {
    width: 100%;
    height: 180px;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    object-fit: cover;
}

.social-card-body {
    padding: 1rem;
}

.social-card-site {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.social-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.25rem 0;
    color: var(--text-main);
}

.social-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Metrics Grid for Word Counter */
.metrics-counter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.metric-stat-card {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.15rem 1rem;
    text-align: center;
}

.metric-stat-val {
    font-size: 1.85rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--brand-primary);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.metric-stat-label {
    font-size: 0.775rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Color Converter Grid */
.color-display-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.color-swatch-large {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
}

.contrast-score-card {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* QR Code Canvas Area */
.qr-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: var(--bg-base);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.qr-canvas-holder {
    background: #ffffff;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
}
