/* Squimg tool page (/tools/squimg) */
:root {
    --sq-accent: #f94c3b;
    --sq-accent-soft: #fff5f4;
}

.sq-drop {
    border: 2px dashed #cfd4da;
    border-radius: .75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    color: #495057;
    transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.sq-drop:hover,
.sq-drop:focus,
.sq-drop.is-over {
    border-color: var(--sq-accent);
    background: var(--sq-accent-soft);
    outline: none;
}

.sq-drop.is-over {
    transform: scale(1.01);
    box-shadow: 0 .5rem 1.5rem rgba(249, 76, 59, .15);
}

.sq-drop.is-disabled {
    opacity: .55;
    pointer-events: none;
}

.sq-drop svg {
    width: 56px;
    height: 56px;
    color: var(--sq-accent);
}

.sq-drop-title {
    font-family: Raleway, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 1rem 0 .25rem;
}

.sq-drop-sub {
    color: #6c757d;
}

.sq-link {
    color: var(--sq-accent);
    text-decoration: underline;
}

/* file list */
.sq-table td,
.sq-table th {
    vertical-align: middle;
}

.sq-table thead th {
    border-top: 0;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
}

.sq-col-thumb {
    width: 64px;
}

.sq-col-status {
    min-width: 150px;
}

.sq-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: .35rem;
    background: #e9ecef;
    display: block;
}

.sq-name {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.sq-type {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #adb5bd;
}

.sq-row {
    transition: background .4s ease;
}

.sq-row-queued .sq-status {
    color: #adb5bd;
}

.sq-row-working {
    animation: sq-pulse 1.4s ease-in-out infinite;
}

@keyframes sq-pulse {
    0%, 100% { background: #fff8f7; }
    50% { background: #ffe9e6; }
}

.sq-row-done {
    animation: sq-pop .8s ease-out;
}

@keyframes sq-pop {
    0% { background: #e6f7ec; }
    100% { background: transparent; }
}

.sq-row-failed,
.sq-row-rejected {
    background: #fdf3f3;
}

.sq-row-rejected td {
    color: #868e96;
}

.sq-status {
    white-space: nowrap;
    font-size: .875rem;
}

.sq-spin {
    color: var(--sq-accent);
}

.sq-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: .4rem;
    min-width: 110px;
}

.sq-bar > span {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--sq-accent);
    border-radius: 3px;
    transition: width .7s cubic-bezier(.2, .8, .2, 1);
}

.sq-bar.is-optimal > span {
    background: #adb5bd;
}

.badge.sq-badge {
    font-size: .8rem;
    padding: .35em .55em;
}

/* side panel */
.sq-panel {
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .06);
}

.bg-accent {
    background-color: var(--sq-accent) !important;
}

#sq-quality::-webkit-slider-thumb { background: var(--sq-accent); }
#sq-quality::-moz-range-thumb { background: var(--sq-accent); }

.sq-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    text-align: center;
}

.sq-stat-label {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
}

.sq-stat-value {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
}

.sq-ring {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
    position: relative;
}

.sq-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.sq-ring-bg {
    fill: none;
    stroke: #eef0f2;
    stroke-width: 3.5;
}

.sq-ring-fg {
    fill: none;
    stroke: var(--sq-accent);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 0 100;
    transition: stroke-dasharray 1.2s cubic-bezier(.2, .8, .2, 1);
}

.sq-ring-text {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sq-ring-pct {
    font-family: Raleway, sans-serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
}

.sq-ring-sub {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    margin-top: .25rem;
}

.sq-expiry {
    text-align: center;
    margin-top: .6rem;
    font-size: .9rem;
    color: #6c757d;
}

.sq-expiry strong {
    font-variant-numeric: tabular-nums;
}

.sq-expiry.is-soon strong {
    color: var(--sq-accent);
}

.sq-expiry.is-expired {
    color: #dc3545;
    font-weight: 700;
}

#sq-summary.is-expired #sq-download {
    pointer-events: none;
    opacity: .5;
}

@media (max-width: 767px) {
    .sq-drop { padding: 2rem 1rem; }
    .sq-name { max-width: 160px; }
}

/* phones: drop the thumbnail column and tighten cells so the whole row fits without side-scrolling */
@media (max-width: 575px) {
    .sq-table { table-layout: fixed; width: 100%; }
    .sq-col-thumb,
    .sq-table td:first-child { display: none; }
    .sq-table td { padding: .5rem .3rem; font-size: .85rem; word-wrap: break-word; }
    .sq-table th { padding: .5rem .3rem; font-size: .68rem; letter-spacing: 0; }
    .sq-table th:nth-child(3),
    .sq-table th:nth-child(4) { width: 21%; }
    .sq-col-status { width: 33%; min-width: 0; }
    .sq-name { max-width: 100%; }
    .sq-bar { min-width: 0; }
    .sq-status { white-space: normal; }
}
