/* 
   ToolsHub Tool-specific Stylesheet
   Styling for interactive components inside tool workspaces
*/

/* 1. TOOL WORKSPACE CARD */
.tool-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 35px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto 50px;
}

/* 2. DYNAMIC INPUTS & CONTROLS */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.12);
    background-color: var(--bg-card);
}

textarea.form-control {
    resize: vertical;
    min-height: 160px;
}

/* Horizontal input rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Radio & Checkbox options */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 15px 0 25px;
}

.option-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.92rem;
}

.option-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* 3. FILE UPLOAD DROPZONE */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background-color: var(--bg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    margin-bottom: 25px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.03);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: inline-block;
    opacity: 0.8;
}

.dropzone-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.dropzone-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File list item details */
.file-list-preview {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 18px;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-preview-icon {
    font-size: 1.6rem;
}

.file-preview-name {
    font-size: 0.88rem;
    font-weight: 600;
    word-break: break-all;
}

.file-preview-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-preview-remove {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--danger);
    cursor: pointer;
    line-height: 1;
}

/* 4. WORKSPACE RESULT CONTAINER */
.result-box-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-box-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.result-output-area {
    width: 100%;
    min-height: 150px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--text);
    overflow-y: auto;
    white-space: pre-wrap;
    position: relative;
}

/* Copy and action buttons triggers */
.action-buttons-flex {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 5. LIVE STATS COUNTER FOR TEXT AREAS */
.tool-live-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin: 15px 0 25px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.live-stat-card {
    display: flex;
    flex-direction: column;
}

.live-stat-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.live-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* 6. PROGRESS LOADING INDICATOR */
.progress-bar-wrapper {
    height: 6px;
    width: 100%;
    background-color: var(--border);
    border-radius: 50px;
    overflow: hidden;
    margin: 20px 0;
    display: none;
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background-color: var(--primary);
    transition: width 0.1s ease;
}

/* Image preview containers */
.image-viewport-preview {
    display: flex;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg);
    overflow: hidden;
    max-height: 400px;
    padding: 10px;
    margin-bottom: 25px;
}

.image-viewport-preview img {
    object-fit: contain;
    max-height: 380px;
}

/* Grayscale preview split compare */
.image-split-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.image-compare-panel {
    text-align: center;
}

.image-compare-panel h4 {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.image-compare-panel .img-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--bg);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
}

.image-compare-panel img {
    max-height: 230px;
    object-fit: contain;
}
