/* ============================================================
   tools-shared.css — shared styles for all tool pages
   ============================================================ */

/* ── Tokens ── */
:root {
    --orange:  #FF5000;
    --orange-h:#C93E00;
    --orange-d:#fff3ee;
    --orange-b:#ffb399;
    --teal:    #0E5C56;
    --teal-d:  #eef7f6;
    --teal-b:  #7dbfbb;
    --ink:     #14110F;
    --sub:     #6B6560;
    --surface: #FAF8F6;
    --card:    #ffffff;
    --border:  rgba(0,0,0,.07);
    --ok:      #2E7D4F;
    --ok-d:    #f0fdf6;
    --err:     #C1401F;
    --err-d:   #fdf2ee;
    --r:       16px;
    --r2:      12px;
    --ease:    cubic-bezier(.4,0,.2,1);
    --tr:      .17s var(--ease);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body { background: var(--surface); min-height: 100vh; font-family: 'Roboto', sans-serif; color: var(--ink); display: flex; flex-direction: column; }
body > .container-fluid { flex: 1; }

/* ── Page background blobs ── */
.cv-scene {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 50% 40% at 12% 10%, rgba(255,80,0,.06) 0%, transparent 100%),
        radial-gradient(ellipse 40% 35% at 88% 90%, rgba(14,92,86,.05) 0%, transparent 100%);
}

/* ── Page header ── */
.cv-head { position: relative; z-index: 1; padding: 36px 24px 20px; text-align: center; }
.cv-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .11em;
    color: var(--sub); margin-bottom: 10px;
}
.cv-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.cv-title { font-size: clamp(1.55rem,3vw,2.25rem); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); }
.cv-title strong { color: var(--orange); }
.cv-sub { font-size: .83rem; color: var(--sub); margin-top: 6px; }

/* ── Layout ── */
.cv-wrap { position: relative; z-index: 1; padding: 0 20px 48px; }
.cv-max  { max-width: 680px; margin: 0 auto; }

/* ── Tool card ── */
.tool-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
    padding: 28px 26px; position: relative; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.07), 0 12px 40px rgba(0,0,0,.05);
}
.tool-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--orange) 0%, rgba(255,80,0,.1) 100%);
    border-radius: var(--r) var(--r) 0 0;
}

/* ── Card header ── */
.cv-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.cv-card-icon {
    width: 40px; height: 40px; border-radius: 11px;
    background: var(--orange-d); color: var(--orange);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.cv-card-icon.teal { background: var(--teal-d); color: var(--teal); }
.cv-card-title { font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.cv-card-sub   { font-size: .7rem; color: var(--sub); margin-top: 1px; }
.cv-label {
    font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
    color: var(--sub); display: block; margin-bottom: 6px;
}

/* ── Drag & drop upload area ── */
.drag-area {
    border: 1.5px dashed var(--orange-b); border-radius: var(--r2);
    padding: 36px 20px; text-align: center; cursor: pointer;
    background: var(--orange-d);
    transition: background var(--tr), border-color var(--tr), transform var(--tr);
    margin-bottom: 18px;
}
.drag-area:hover { background: var(--orange-d); filter: brightness(.95); border-color: var(--orange); }
.dragover {
    background: var(--orange-d) !important; filter: brightness(.9); border-color: var(--orange) !important;
    transform: scale(1.01); box-shadow: 0 0 0 3px rgba(255,80,0,.14);
}
.dz-icon-wrap {
    width: 48px; height: 48px; border-radius: 13px;
    background: rgba(255,80,0,.14); border: 1px solid rgba(255,80,0,.28);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--orange);
    margin: 0 auto 12px; transition: transform var(--tr);
}
.dragover .dz-icon-wrap { transform: translateY(-4px) scale(1.06); }
.drag-area p { font-size: .84rem; font-weight: 600; color: var(--ink); margin: 0 0 3px; }
.drag-area p span { color: var(--orange); text-decoration: underline; text-underline-offset: 2px; }
.drag-area small { font-size: .68rem; color: var(--sub); }

/* ── File list ── */
#fileList { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 14px; background: var(--card); }
#fileList .list-group-item {
    background: transparent; border-color: var(--border); padding: 9px 13px;
    display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--ink);
}
#fileList .list-group-item i     { color: var(--orange); font-size: .9rem; }
#fileList .list-group-item small { color: var(--sub); font-size: .68rem; margin-left: auto; }

/* ── Progress bar ── */
.prog-wrap      { margin-top: 12px; }
.prog-bar-track { width: 100%; height: 3px; background: var(--border); border-radius: 100px; overflow: hidden; margin-bottom: 9px; }
.prog-bar-fill  { height: 100%; border-radius: 100px; width: 0%; background: var(--orange); transition: width .3s var(--ease), background .3s; }
.prog-bar-fill.success { background: var(--ok); }
.prog-bar-fill.danger  { background: var(--err); }
.prog-bar-fill.warning { background: #D98E04; }
.prog-stats  { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; }
.prog-pct    { font-size: .86rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.prog-details { text-align: right; }
.prog-mb     { font-size: .68rem; color: var(--sub); }
.prog-spd    { font-size: .62rem; color: var(--sub); margin-top: 1px; }

/* ── Processing spinner ── */
#processingIndicator {
    display: flex; align-items: center; gap: 8px;
    background: rgba(217,142,4,.08); border: 1px solid rgba(217,142,4,.24);
    border-radius: 9px; padding: 10px 14px;
    font-size: .79rem; font-weight: 500; color: #7a5000;
}

/* ── Limit chips ── */
.limits-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.limit-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--orange-d); border: 1px solid var(--orange-b);
    border-radius: 999px; padding: 4px 11px;
    font-size: .68rem; font-weight: 600; color: var(--orange);
}

/* ── Preview panel ── */
.preview-panel {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
    overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.07);
}
.preview-title {
    font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
    color: var(--sub); padding: 12px 16px; border-bottom: 1px solid var(--border);
    background: var(--bg, var(--surface)); display: flex; align-items: center; gap: 7px;
}
.pt-dot           { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pt-dot-orange    { background: var(--orange); }
.pt-dot-teal      { background: var(--teal); }
.pt-badge         { margin-left: auto; background: var(--teal-d); color: var(--teal); border-radius: 5px; padding: 2px 7px; font-size: .62rem; font-weight: 700; }

/* ── Image preview card ── */
.img-card {
    background: var(--card); padding: 20px; min-height: 340px;
    display: flex; justify-content: center; align-items: center;
}
.img-card img { max-width: 100%; max-height: 480px; object-fit: contain; border-radius: 8px; transition: transform var(--tr); }
.img-card img:hover { transform: scale(1.01); }

/* ── Buttons ── */
.btn-download {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--teal); color: #fff; border: none;
    font-weight: 700; font-size: .84rem; padding: 11px 22px;
    border-radius: 9px; text-decoration: none;
    transition: background var(--tr), transform var(--tr), box-shadow var(--tr);
}
.btn-download:hover { background: #0a4440; color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(14,92,86,.28); }
.btn-download.hidden { display: none; }

.btn-action {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; background: var(--orange); color: #fff; border: none;
    font-weight: 700; font-size: .9rem; padding: 13px 20px;
    border-radius: 10px; cursor: pointer; margin-top: 18px;
    transition: background var(--tr), transform var(--tr);
}
.btn-action:hover:not(:disabled) { background: var(--orange-h); transform: translateY(-1px); }
.btn-action:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-download:hover, .btn-action.btn-download:hover:not(:disabled) { background: #0a4440 !important; color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(14,92,86,.28); }

/* ── Form controls ── */
.cv-input {
    width: 100%; border: 1.5px solid var(--border); border-radius: 9px;
    padding: 9px 12px; font-size: .84rem; font-family: inherit; color: var(--ink);
    background: var(--card); outline: none;
    transition: border-color var(--tr), box-shadow var(--tr);
}
.cv-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,80,0,.1); }
.cv-select {
    width: 100%; border: 1.5px solid var(--border); border-radius: 9px;
    padding: 9px 12px; font-size: .84rem; font-family: inherit; color: var(--ink);
    background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236B6560' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none; outline: none;
    transition: border-color var(--tr);
}
.cv-select:focus { border-color: var(--orange); }
.cv-hint { font-size: .68rem; color: var(--sub); margin-top: 4px; }

/* ── Message / toast ── */
#messageBox {
    position: fixed; top: 16px; right: 16px; z-index: 9999;
    padding: 10px 14px; color: #fff; border-radius: 11px;
    font-weight: 600; font-size: .79rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: 310px;
    backdrop-filter: blur(16px); display: none; align-items: center; gap: 7px;
}
.alert-success { background: rgba(46,125,79,.94);  border: 1px solid rgba(46,125,79,.4); }
.alert-danger  { background: rgba(193,64,31,.94);  border: 1px solid rgba(193,64,31,.4); }
.alert-warning { background: rgba(217,142,4,.94);  border: 1px solid rgba(217,142,4,.4); }
.alert-info    { background: rgba(14,92,86,.94);   border: 1px solid rgba(14,92,86,.4); }

/* ── Responsive ── */
@media (max-width: 576px) {
    .tool-card { padding: 20px 16px; }
    .img-card  { min-height: 220px; }
    .img-card img { max-height: 260px; }
}

/* ── Result pulse animation (triggered after processing) ── */
@keyframes resultPop {
    0%   { box-shadow: 0 0 0 0   rgba(255, 80, 0, .35); }
    70%  { box-shadow: 0 0 0 10px rgba(255, 80, 0, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(255, 80, 0, 0);    }
}
.result-pop { animation: resultPop .7s ease-out; }
