/* ============================================
   SHARED IMAGE TOOL STYLES
   Used by: image-compressor, image-resizer, image-converter
   ============================================ */

.tl-image-compressor,
.tl-image-resizer,
.tl-image-converter {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* Drop Zone */
.tl-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #f9fafb;
}
.tl-drop-zone:hover,
.tl-drop-zone.dragover {
    border-color: var(--primary-color, #072d6e);
    background: #f0f4ff;
}
.tl-drop-icon { font-size: 48px; margin-bottom: 12px; }
.tl-drop-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}
.tl-drop-sub {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Preview grid */
.tl-image-preview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) {
    .tl-image-preview-grid { grid-template-columns: 1fr 1fr; }
}

.tl-preview-pane {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.tl-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f3f4f6;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.tl-badge {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
}
.tl-badge-green {
    background: #d1fae5;
    color: #065f46;
}
.tl-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.tl-preview-img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #1e1e2e;
    display: block;
    padding: 8px;
    box-sizing: border-box;
}

/* Slider */
.tl-slider-group {
    margin-top: 20px;
}
.tl-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
.tl-range {
    width: 100%;
    accent-color: var(--primary-color, #072d6e);
    cursor: pointer;
}

/* Input / select */
.tl-input, .tl-select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.tl-input:focus, .tl-select:focus { border-color: var(--primary-color, #072d6e); }

/* Option groups */
.tl-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}
.tl-option-group { flex: 1; min-width: 140px; }

/* Mode switch (reused from dev tools) */
.tl-mode-switch { display: flex; gap: 12px; flex-wrap: wrap; }
.tl-mode-option {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; padding: 10px 18px;
    border: 2px solid #e5e7eb; border-radius: 8px;
    font-weight: 600; font-size: 14px; color: #374151;
    transition: all 0.2s; user-select: none;
}
.tl-mode-option:has(input:checked) {
    border-color: var(--primary-color, #072d6e);
    background: #f0f4ff; color: var(--primary-color, #072d6e);
}
.tl-mode-option input { display: none; }

/* Checkbox */
.tl-checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: #374151;
    cursor: pointer; font-weight: 500;
}

/* Stat row */
.tl-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.tl-stat-item { text-align: center; flex: 1; min-width: 80px; }
.tl-stat-value { font-size: 20px; font-weight: 700; color: var(--primary-color, #072d6e); display: block; }
.tl-stat-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }

/* Actions */
.tl-tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.button {
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
    border: none;
}
.button-primary { background: var(--primary-color, #072d6e); color: #fff; }
.button-primary:hover { opacity: 0.88; }
.button-secondary { background: #f3f4f6; color: #111827; border: 1px solid #d1d5db; }
.button-secondary:hover { background: #e5e7eb; }
