/* ============================================================
   Download Overlay — download-overlay.css
   Color scheme: #2e7d32 (primary green), #1a5c2a (backdrop)
   Accent: #d4e8d0 (light green), #f5c200 (gold)
   ============================================================ */

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes dlFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes dlFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes dlSlideUp {
    from { opacity: 0; transform: translateY(52px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dlCheckDraw {
    from { stroke-dashoffset: 80; }
    to   { stroke-dashoffset: 0;  }
}
@keyframes dlScalePop {
    0%   { transform: scale(0.55); opacity: 0; }
    65%  { transform: scale(1.10); }
    100% { transform: scale(1);    opacity: 1; }
}
@keyframes dlPulseRing {
    0%,100% { box-shadow: 0 0 0 0   rgba(46,125,50,.38); }
    50%     { box-shadow: 0 0 0 14px rgba(46,125,50,0);   }
}
@keyframes dlSpeedPulse {
    0%,100% { opacity: 0.5; }
    50%     { opacity: 1;   }
}
@keyframes dlRingGlow {
    0%,100% { filter: drop-shadow(0 0  4px rgba(46,125,50,.30)); }
    50%     { filter: drop-shadow(0 0 11px rgba(46,125,50,.68)); }
}

/* ── Backdrop ──────────────────────────────────────────────── */
.dl-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(26, 92, 42, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dlFadeIn 0.28s ease both;
}
.dl-overlay.dl-hiding {
    animation: dlFadeOut 0.22s ease both;
}

/* ── Particle canvas ───────────────────────────────────────── */
.dl-particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ── Modal card ────────────────────────────────────────────── */
.dl-modal {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 28px 28px;
    width: 340px;
    max-width: calc(100vw - 32px);
    box-shadow:
        0 28px 72px rgba(0, 0, 0, .40),
        0  4px 18px rgba(46, 125, 50, .22);
    animation: dlSlideUp 0.40s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    z-index: 1;
}

/* ── Close button ──────────────────────────────────────────── */
.dl-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f7f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #2e7d32;
    font-size: 18px;
    line-height: 1;
    transition: background .15s, transform .15s;
    z-index: 2;
}
.dl-close-btn:hover {
    background: #ddf0dd;
    transform: scale(1.12);
}

/* ── Header (filename + size) ──────────────────────────────── */
.dl-header {
    text-align: center;
    margin-bottom: 20px;
}
.dl-filename {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.94rem;
    color: #1a3a22;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
    margin-inline: auto;
}
.dl-filesize {
    font-size: 0.78rem;
    color: #5a7d5a;
    margin: 0;
}

/* ── Ring progress ─────────────────────────────────────────── */
.dl-ring-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}
.dl-ring-svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
    animation: dlRingGlow 2.6s ease-in-out infinite;
}
.dl-ring-bg {
    fill: none;
    stroke: #e8f5e9;
    stroke-width: 8;
}
.dl-ring-glow {
    fill: none;
    stroke: rgba(46, 125, 50, .22);
    stroke-width: 13;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset .45s ease;
}
.dl-ring-track {
    fill: none;
    stroke: #2e7d32;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset .45s ease;
}
.dl-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.dl-pct {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #2e7d32;
    line-height: 1;
}
.dl-pct-small {
    font-size: 0.67rem;
    font-weight: 600;
    color: #8aaa8a;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

/* ── Status message ────────────────────────────────────────── */
.dl-status-msg {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4a7a4a;
    min-height: 18px;
    margin-bottom: 12px;
    transition: opacity .25s;
}

/* ── Speed bar ─────────────────────────────────────────────── */
.dl-speed-wrap { margin: 0 0 6px; }
.dl-speed-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #8aaa8a;
    margin-bottom: 5px;
}
.dl-speed-track {
    height: 4px;
    background: #e8f5e9;
    border-radius: 3px;
    overflow: hidden;
}
.dl-speed-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2e7d32 0%, #76c442 100%);
    border-radius: 3px;
    transition: width .32s ease;
    animation: dlSpeedPulse 1.3s ease-in-out infinite;
}

/* ── Done / success state ──────────────────────────────────── */
.dl-done-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
}
.dl-done-wrap.dl-visible {
    display: flex;
    animation: dlScalePop .42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.dl-check-circle {
    width: 82px;
    height: 82px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    animation: dlPulseRing 1.8s ease-in-out 1;
}
.dl-check-circle svg {
    width: 46px;
    height: 46px;
}
.dl-check-path {
    fill: none;
    stroke: #2e7d32;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: dlCheckDraw .55s cubic-bezier(.4, 0, .2, 1) .12s forwards;
}
.dl-done-title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a3a22;
    margin: 0 0 5px;
}
.dl-done-sub {
    font-size: 0.80rem;
    color: #5a7d5a;
    margin: 0 0 20px;
    text-align: center;
    max-width: 260px;
}

/* ── Action buttons ────────────────────────────────────────── */
.dl-btn-row {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}
.dl-btn-primary {
    flex: 1;
    background: #2e7d32;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    transition: background .15s, transform .1s;
}
.dl-btn-primary:hover {
    background: #237026;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}
.dl-btn-secondary {
    flex: 1;
    background: transparent;
    color: #2e7d32;
    border: 2px solid #2e7d32;
    border-radius: 10px;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s;
}
.dl-btn-secondary:hover {
    background: #f0f9f0;
    transform: translateY(-1px);
}
