/* Hero */
.tool-hero {
    padding: 2.5rem 0 1.5rem;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, #fff8ee 0%, #fff 60%);
    border-bottom: 1px solid #f0f0f0;
}
.tool-hero h1 {
    font-size: 1.9rem;
    color: var(--dark);
    margin-bottom: 0.4rem;
}
.tool-hero p {
    color: var(--gray);
    font-size: 1rem;
}

/* Converter space */
.converter-section {
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
    padding: 2rem 0;
}
.converter-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 580px;
    background: #fff;
    border: 1px solid #e8e8e8;
    max-width: 1400px;
    margin: 0 auto;
}

/* converter sidebar */
.conv-sidebar {
    border-right: 1px solid #eee;
    padding: 18px;
    overflow-y: auto;
    background: #fafafa;
}

/* ── Dropzone ── */
@keyframes dz-march {
    to { stroke-dashoffset: -40; }
}
@keyframes dz-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-5px); }
}
@keyframes dz-glow-pulse {
    0%, 100% { opacity: 0; }
    50%       { opacity: 1; }
}
@keyframes dz-shimmer {
    0%   { transform: translateX(-100%) rotate(20deg); }
    100% { transform: translateX(200%) rotate(20deg); }
}

.dropzone {
    border-radius: 12px;
    height: 152px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    background: linear-gradient(145deg, #fffdf9 0%, #fff8ee 100%);
    text-align: center;
    /* soft orange shadow ring */
    box-shadow: 0 0 0 1.5px #ffe0a0, 0 4px 18px rgba(255,153,0,0.10);
    transition: box-shadow 0.25s, background 0.25s;
}

/* SVG animated border */
.dropzone::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    /* drawn by the SVG overlay below - this layer adds the inner glow */
    background: transparent;
    pointer-events: none;
}

/* Marching-dashes via inline SVG injected by ::after trick */
/* We use outline + clip-path workaround: SVG rect as background-image */
.dropzone .dz-border-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 12px;
    overflow: visible;
}
.dropzone .dz-border-svg rect {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-dasharray: 8 6;
    stroke-linecap: round;
    rx: 10;
    ry: 10;
    animation: dz-march 0.9s linear infinite;
    opacity: 0.55;
}
.dropzone.active .dz-border-svg rect {
    animation: none;
}
.dropzone.active:hover .dz-border-svg rect, .dropzone.active.drag-over .dz-border-svg rect {
    animation: dz-march 0.9s linear infinite;
}

/* Shimmer sweep on hover */
.dropzone::after {
    content: "";
    position: absolute;
    top: -60%;
    left: -40%;
    width: 60%;
    height: 220%;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,153,0,0.12) 50%,
        transparent 70%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.dropzone:hover::after {
    opacity: 1;
    animation: dz-shimmer 0.9s ease forwards;
}

.dropzone:hover,
.dropzone.drag-over {
    background: linear-gradient(145deg, #fff8ee 0%, #fff1d6 100%);
    box-shadow: 0 0 0 2px var(--primary), 0 6px 24px rgba(255,153,0,0.18);
}
.dropzone:hover .dz-border-svg rect,
.dropzone.drag-over .dz-border-svg rect {
    opacity: 1;
    stroke-width: 2.5;
}

.dropzone img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    z-index: 1;
}

.dropzone .dz-hint {
    color: var(--gray);
    font-size: 12px;
    line-height: 1.7;
    position: relative;
    z-index: 2;
}

.dropzone .dz-icon {
    font-size: 28px;
    display: block;
    position: relative;
    z-index: 2;
    /* floating bob */
    animation: dz-float 2.6s ease-in-out infinite;
    filter: drop-shadow(0 2px 6px rgba(255,153,0,0.35));
}

.dropzone .dz-fname {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    text-align: center;
    z-index: 3;
}
#file-input {
    display: none;
}

/* Param section title */
.ps {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 6px;
}
.ps::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ebebeb;
}

/* Presets */
.presets {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}
.presets__btn {
    flex: 1;
    padding: 7px 0;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    color: var(--dark);
    font-family: inherit;
}
.presets__btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.presets__btn--active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

/* Segmented */
.seg {
    display: flex;
    background: #f0f0f0;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}
.seg button {
    flex: 1;
    padding: 6px 0;
    background: transparent;
    border: none;
    font-size: 11px;
    cursor: pointer;
    transition: 0.15s;
    color: #777;
    font-family: inherit;
}
.seg button.active {
    background: var(--dark);
    color: #fff;
    font-weight: 600;
}

/* Slider */
.sl-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    font-size: 12px;
    color: var(--dark);
}
.sl-val {
    color: #aaa;
    font-variant-numeric: tabular-nums;
}
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    margin-bottom: 8px;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(255, 153, 0, 0.35);
}

/* Switch */
.sw-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.sw-label {
    font-size: 12px;
    color: var(--dark);
}
.sw-sub {
    font-size: 10px;
    color: #aaa;
    margin-top: 1px;
}
.sw {
    position: relative;
    width: 38px;
    height: 21px;
    flex-shrink: 0;
}
.sw input {
    opacity: 0;
    width: 0;
    height: 0;
}
.sw-track {
    position: absolute;
    inset: 0;
    background: #ddd;
    border-radius: 11px;
    cursor: pointer;
    transition: 0.2s;
}
.sw-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    background: #aaa;
    border-radius: 50%;
    transition: 0.2s;
}
.sw input:checked + .sw-track {
    background: var(--primary);
}
.sw input:checked + .sw-track::after {
    transform: translateX(17px);
    background: #fff;
}

/* Advanced */
#adv-toggle {
    width: 100%;
    padding: 7px 12px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    transition: 0.15s;
    margin-top: 2px;
    font-family: inherit;
}
#adv-toggle:hover {
    border-color: var(--primary);
    color: var(--dark);
}
#adv-content {
    display: none;
}
#adv-content.open {
    display: block;
}

/* preview panel */
.preview {
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    overflow: hidden;
}
.preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.preview__title {
    font-weight: 700;
    color: var(--dark);
    font-size: 13px;
}
.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #aaa;
}
.live-dot {
    width: 7px;
    height: 7px;
    background: #4caf7d;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Preview body - fills all remaining height */
.preview__body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: repeating-conic-gradient(#f5f5f5 0% 25%, #fff 0% 50%) 0 0 / 20px
        20px;
}

/* SVG fills the container */
#preview__body__svg-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
#preview__body__svg-container svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview__body__svg-container__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ccc;
    gap: 10px;
}
.preview__body__svg-container__placeholder__icon {
    font-size: 52px;
}
.preview__body__svg-container__placeholder p {
    font-size: 13px;
}

.preview__footer {
    padding: 11px 20px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: #fff;
}
#status {
    flex: 1;
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#status.ok {
    color: #2e7d32;
}
#status.error {
    color: #c62828;
}

#btn-dl {
    padding: 9px 22px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    font-family: inherit;
}
#btn-dl:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
#btn-dl:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Overlay */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.88);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}
.overlay.active {
    display: flex;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.overlay__text {
    font-size: 13px;
    color: var(--gray);
    font-weight: 600;
}


.howItWorksCardContainer__icon {
    font-size:2.5rem;
    margin-bottom:1rem;
}

.preset-explain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.preset-explain-grid__card {
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 2px solid transparent;
}
.preset-explain-grid__card.bw {
    background: #f8f8f8;
    border-color: #ccc;
}
.preset-explain-grid__card.poster {
    background: #fff8ee;
    border-color: var(--primary);
}
.preset-explain-grid__card.photo {
    background: #f0f7ff;
    border-color: #5b9bd5;
}
.preset-explain-grid__card h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.preset-label {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}
.bw .preset-label {
    background: #333;
    color: #fff;
}
.poster .preset-label {
    background: var(--primary);
    color: #fff;
}
.photo .preset-label {
    background: #5b9bd5;
    color: #fff;
}
.preset-explain-grid__card p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
}
.preset-explain-grid__card ul {
    color: var(--gray);
    font-size: 0.9rem;
    padding-left: 1.2rem;
    margin-top: 0.5rem;
}
.preset-explain-grid__card li {
    margin-bottom: 0.3rem;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.use-case-grid__card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: 0.2s;
}
.use-case-grid__card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.uc-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}
.use-case-grid__card h3 {
    color: var(--dark);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.use-case-grid__card p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

#DownloadDesktopV .container {
    text-align: center;
}
#DownloadDesktopV h2 {
    color:var(--dark);
    margin-bottom:1rem;
}
#DownloadDesktopV p {
    color:var(--gray);
    max-width:600px;
    margin:0 auto 2rem;
}

@media (max-width: 900px) {
    .converter-wrap {
        grid-template-columns: 1fr;
    }
    .conv-sidebar {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .preview__body {
        min-height: 360px;
    }
}





/* ============================================================
   ADD TO online.css
   Tooltip system for parameter help buttons
   ============================================================ */

/* ── ? button ─────────────────────────────────────────────── */
.param-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.param-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width:  15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: transparent;
    color: inherit;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s, border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
    /* Reset any inherited button styles */
    font-family: inherit;
    letter-spacing: 0;
}

.param-help:hover,
.param-help:focus-visible {
    opacity: 1;
    transform: scale(1.15);
    outline: none;
}

/* ── Tooltip card ─────────────────────────────────────────── */
#param-tooltip {
    /* position géré inline par JS (fixed) */
    z-index: 9999;
    width: 230px;
    padding: 10px 13px 11px;
    border-radius: 9px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.35),
        0 10px 25px -5px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.97);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

#param-tooltip.tt-visible {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

#param-tooltip::after {
    content: "";
    position: absolute;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}
#param-tooltip[data-arrow="down"]::after {
    bottom: -6px;
    border-top: 6px solid #18181b;
    border-bottom: none;
}
#param-tooltip[data-arrow="up"]::after {
    top: -6px;
    border-bottom: 6px solid #18181b;
    border-top: none;
}

.tt-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 5px;
}
.tt-text {
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}