/* ================================================================
   Minkesh Image Tool  –  v2.2
   ================================================================ */

.mit-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 28px 18px 44px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #222;
    box-sizing: border-box;
}

.mit-wrap *, .mit-wrap *::before, .mit-wrap *::after {
    box-sizing: border-box;
}

/* ── Title ──────────────────────────────────────────────────────── */
.mit-title {
    font-size: 40px;
    font-weight: 800;
    color: #111;
    margin: 0 0 24px;
    line-height: 1.15;
    padding: 0;
    border: none;
    background: none;
}

/* ── Upload Zone ────────────────────────────────────────────────── */
.mit-drop-zone {
    border: 2.5px dashed #9b96d6;
    background: #fafafe;
    border-radius: 6px;
    padding: 38px 20px 32px;
    text-align: center;
    cursor: pointer;
    transition: background .18s, border-color .18s;
    margin-bottom: 10px;
}

.mit-drop-zone.is-over {
    background: #eeeeff;
    border-color: #6a60c0;
}

.mit-drop-text {
    font-size: 20px;
    color: #999;
    margin: 0 0 22px;
    font-weight: 400;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.mit-btn {
    display: inline-block;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    transition: background .18s, opacity .18s;
    line-height: 1;
}

.mit-btn-primary {
    background: #1a8060;
    color: #fff;
    padding: 14px 44px;
    font-size: 16px;
}

.mit-btn-primary:hover  { background: #156e52; }
.mit-btn-primary:active { background: #115f47; }

.mit-btn-primary:disabled,
.mit-btn-primary[disabled] {
    background: #bbb;
    cursor: not-allowed;
    opacity: .8;
}

.mit-resize-btn {
    padding: 15px 54px;
    font-size: 18px;
    margin-top: 4px;
}

/* ── File List ──────────────────────────────────────────────────── */
.mit-file-list { margin-bottom: 6px; }

.mit-file-item {
    font-size: 13px;
    color: #666;
    padding: 5px 10px;
    background: #f4f4f4;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* ── Options Block ──────────────────────────────────────────────── */
.mit-options  { margin-top: 20px; }

.mit-row { margin-bottom: 20px; }

.mit-row-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Unit Dropdown ──────────────────────────────────────────────── */
.mit-unit-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mit-small-label {
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

.mit-select {
    padding: 9px 14px;
    border: 1.5px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    background: #fff;
    color: #333;
    cursor: pointer;
    min-width: 170px;
    appearance: auto;
}

.mit-select:focus { outline: none; border-color: #1a8060; }

/* ── Width × Height ─────────────────────────────────────────────── */
.mit-dim-row {
    gap: 16px;
    flex-wrap: nowrap;
}

.mit-input {
    border: 1.5px solid #ccc;
    border-radius: 5px;
    padding: 11px 16px;
    font-size: 15px;
    color: #333;
    background: #fff;
    width: 200px;
}

.mit-input:focus { outline: none; border-color: #1a8060; }

/* Remove number arrows (optional cleaner look) */
.mit-input[type=number]::-webkit-inner-spin-button,
.mit-input[type=number]::-webkit-outer-spin-button { opacity: 1; }

.mit-x {
    font-size: 22px;
    font-weight: 700;
    color: #555;
    flex-shrink: 0;
    user-select: none;
}

/* ── Maintain Aspect Ratio ──────────────────────────────────────── */
.mit-aspect-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.mit-aspect-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #1a8060;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid #bbb;
    appearance: auto;
}

/* ── Compress to specific size (centered) ───────────────────────── */
.mit-specific-size {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

/* ── Compress Checkbox ──────────────────────────────────────────── */
.mit-check-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.mit-check-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #1a8060;
    cursor: pointer;
    flex-shrink: 0;
    appearance: auto;
}

/* ── Size Row ───────────────────────────────────────────────────── */
.mit-row-size {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.mit-size-text {
    font-size: 17px;
    color: #333;
    white-space: nowrap;
}

.mit-size-input-group {
    display: flex;
    align-items: stretch;
}

.mit-size-inp {
    width: 120px;
    border-right: none !important;
    border-radius: 5px 0 0 5px !important;
}

.mit-kb-badge {
    background: #1a8060;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 0 14px;
    border-radius: 0 5px 5px 0;
    display: flex;
    align-items: center;
}

/* ── Output Format ──────────────────────────────────────────────── */
.mit-format-row { gap: 20px; flex-wrap: wrap; }

.mit-format-label {
    font-size: 17px;
    color: #333;
}

.mit-radio-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 17px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.mit-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #1a8060;
    cursor: pointer;
    appearance: auto;
}

/* ── Note ───────────────────────────────────────────────────────── */
.mit-note {
    text-align: center;
    font-size: 15px;
    color: #555;
    margin: 6px 0 0;
}

/* ── Results ────────────────────────────────────────────────────── */
.mit-results { margin-top: 30px; }

.mit-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 10px;
    gap: 12px;
    background: #f0fdf8;
    border: 1px solid #a7f0d2;
}

.mit-result-item.mit-error-item {
    background: #fff5f5;
    border-color: #fca5a5;
}

.mit-result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mit-result-name {
    font-weight: 600;
    font-size: 15px;
    word-break: break-all;
}

.mit-result-meta {
    font-size: 13px;
    color: #666;
}

/* Download button */
.mit-dl-btn {
    background: #1a8060;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .3px;
    text-transform: uppercase;
    transition: background .18s;
}

.mit-dl-btn:hover { background: #156e52; }

.mit-rename-confirm {
    margin-top: 8px;
    background: #1a8060;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.mit-rename-confirm:hover { background: #156e52; }

.mit-rename-confirm:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* Processing spinner text */
.mit-processing {
    text-align: center;
    font-size: 15px;
    color: #666;
    padding: 18px 0;
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .mit-title    { font-size: 26px; }
    .mit-dim-row  { flex-direction: column; gap: 10px; }
    .mit-input    { width: 100%; }
    .mit-x        { display: none; }
    .mit-format-row { gap: 12px; }
    .mit-row-size { flex-wrap: wrap; }
    .mit-result-item { flex-direction: column; align-items: flex-start; }
    .mit-dl-btn   { width: 100%; text-align: center; }
}

/* ── Rename row (appears below each result's meta info) ─────────── */
.mit-rename-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.mit-rename-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.mit-rename-field {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
}

.mit-rename-inp {
    border: 1.5px solid #ccc;
    border-right: none !important;
    border-radius: 5px 0 0 5px !important;
    padding: 6px 10px;
    font-size: 13px;
    color: #333;
    background: #fff;
    flex: 1;
    min-width: 0;
    width: auto;
}

.mit-rename-inp:focus {
    outline: none;
    border-color: #1a8060;
}

.mit-rename-ext {
    background: #e8f5f0;
    border: 1.5px solid #ccc;
    border-left: none;
    border-radius: 0 5px 5px 0;
    padding: 6px 10px;
    font-size: 13px;
    color: #1a8060;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

@media (max-width: 520px) {
    .mit-rename-wrap { flex-wrap: wrap; }
    .mit-rename-field { flex: 1 1 100%; }
    .mit-rename-inp { width: 100%; }
}
