/* ═══════════════════════════════════════════════
   WebP Converter — Stylesheet
   Referência visual: TinyPNG
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── Reset & Base ─── */
#webpc-app *,
#webpc-app *::before,
#webpc-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#webpc-app {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a2e;
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
#webpc-header {
    text-align: center;
    margin-bottom: 32px;
}

#webpc-header h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #0f0f23;
    margin-bottom: 8px;
}

#webpc-header p {
    color: #666;
    font-size: 15px;
    font-weight: 300;
}

/* ─── Format Bar ─── */
#webpc-format-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #f7f7fb;
    border: 1px solid #e8e8f0;
    border-radius: 14px;
    padding: 14px 20px;
    margin-bottom: 20px;
}

.webpc-format-label {
    font-size: 13px;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.webpc-format-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.webpc-fmt {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e0e0ec;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
    letter-spacing: 0.3px;
}

.webpc-fmt:hover {
    border-color: #b0a8f8;
    color: #5b4ff0;
    background: #f4f2ff;
}

.webpc-fmt.active {
    background: #5b4ff0;
    border-color: #5b4ff0;
    color: #fff;
    box-shadow: 0 2px 8px rgba(91, 79, 240, 0.25);
}

.webpc-quality-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.webpc-quality-wrap label {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    min-width: 90px;
}

.webpc-quality-wrap label span {
    font-weight: 600;
    color: #5b4ff0;
}

#webpc-quality {
    -webkit-appearance: none;
    appearance: none;
    width: 110px;
    height: 4px;
    background: #e0e0ec;
    border-radius: 99px;
    outline: none;
    cursor: pointer;
}

#webpc-quality::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #5b4ff0;
    box-shadow: 0 1px 4px rgba(91,79,240,0.35);
    cursor: pointer;
    transition: transform 0.15s;
}

#webpc-quality::-webkit-slider-thumb:hover { transform: scale(1.2); }
#webpc-quality::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%; background: #5b4ff0; border: none;
    box-shadow: 0 1px 4px rgba(91,79,240,0.35);
}

/* ─── Dropzone ─── */
#webpc-dropzone {
    border: 2px dashed #d0cef5;
    border-radius: 20px;
    padding: 56px 32px;
    text-align: center;
    background: #faf9ff;
    cursor: pointer;
    transition: all 0.22s ease;
    position: relative;
    outline: none;
}

#webpc-dropzone:hover,
#webpc-dropzone.drag-over {
    border-color: #5b4ff0;
    background: #f0eeff;
    transform: scale(1.005);
}

#webpc-dropzone:focus-visible {
    box-shadow: 0 0 0 3px rgba(91,79,240,0.3);
}

.webpc-drop-icon {
    color: #9d97f0;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.webpc-drop-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.webpc-drop-sub {
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
}

.webpc-drop-sub button {
    background: none;
    border: none;
    color: #5b4ff0;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
}

.webpc-drop-hint {
    font-size: 12px;
    color: #bbb;
    letter-spacing: 0.3px;
}

/* ─── File Count / Actions ─── */
#webpc-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.webpc-count-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#webpc-count-label {
    font-size: 14px;
    color: #666;
}

#webpc-clear-btn {
    background: none;
    border: 1px solid #e0e0ec;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
}

#webpc-clear-btn:hover {
    border-color: #e05c5c;
    color: #e05c5c;
    background: #fff5f5;
}

.webpc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #5b4ff0;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(91,79,240,0.3);
}

.webpc-btn-primary:hover {
    background: #4a3ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(91,79,240,0.4);
}

.webpc-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(91,79,240,0.25);
}

.webpc-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ─── File List ─── */
#webpc-file-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.webpc-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #eeeef6;
    border-radius: 12px;
    padding: 12px 16px;
    transition: border-color 0.2s;
    animation: webpc-slide-in 0.22s ease both;
}

@keyframes webpc-slide-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.webpc-file-item.is-done    { border-color: #c6f0d8; background: #f7fef9; }
.webpc-file-item.is-error   { border-color: #fdd; background: #fffafa; }
.webpc-file-item.is-loading { border-color: #d8d4fd; background: #faf9ff; }

/* Thumbnail */
.webpc-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0eeff;
}

/* File info */
.webpc-file-info {
    flex: 1;
    min-width: 0;
}

.webpc-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webpc-file-meta {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.webpc-saved-badge {
    background: #d4f5e2;
    color: #1a9e55;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: 0.2px;
}

.webpc-bigger-badge {
    background: #fff0e0;
    color: #c06000;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
}

/* Status */
.webpc-file-status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

/* Spinner */
.webpc-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #d8d4fd;
    border-top-color: #5b4ff0;
    border-radius: 50%;
    animation: webpc-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes webpc-spin {
    to { transform: rotate(360deg); }
}

/* Progress bar */
.webpc-progress {
    width: 80px;
    height: 3px;
    background: #ebebfb;
    border-radius: 99px;
    overflow: hidden;
}

.webpc-progress-bar {
    height: 100%;
    background: #5b4ff0;
    border-radius: 99px;
    animation: webpc-progress-anim 1.2s ease-in-out infinite;
    width: 40%;
}

@keyframes webpc-progress-anim {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(150%); }
    100% { transform: translateX(350%); }
}

/* Status text */
.webpc-status-done  { color: #1a9e55; font-weight: 500; }
.webpc-status-error { color: #d94040; font-weight: 500; }
.webpc-status-wait  { color: #aaa; }

/* Check / Error icons */
.webpc-icon-done  { color: #1a9e55; font-size: 18px; }
.webpc-icon-error { color: #d94040; font-size: 18px; }

/* Remove btn */
.webpc-remove-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.webpc-remove-btn:hover { color: #d94040; background: #fff0f0; }

/* ─── Download All ─── */
#webpc-download-wrap {
    margin-top: 32px;
    text-align: center;
    animation: webpc-pop 0.3s cubic-bezier(.22,1,.36,1) both;
}

@keyframes webpc-pop {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.webpc-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0f0f23;
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 15px 36px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(15,15,35,0.22);
}

.webpc-btn-download:hover {
    background: #1e1e40;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(15,15,35,0.28);
}

.webpc-btn-download:active {
    transform: translateY(0);
}

.webpc-download-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #aaa;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    #webpc-app { padding: 32px 16px 60px; }
    #webpc-header h1 { font-size: 24px; }
    #webpc-dropzone { padding: 40px 16px; }
    #webpc-format-bar { flex-direction: column; align-items: flex-start; }
    .webpc-quality-wrap { margin-left: 0; }
    #webpc-actions { flex-direction: column; align-items: stretch; }
    .webpc-btn-primary { justify-content: center; }
}
