/* =========================================================
   Drag & Drop Overlay — Premium Redesign
   - Beautiful glass-morphism design
   - Optimised for light & dark mode
   - Fully responsive across all screen widths
   ========================================================= */

.drop-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    /* Layered backdrop: subtle radial wash + dim overlay */
    background:
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(56, 189, 248, 0.14), transparent 60%),
        rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        backdrop-filter 0.25s ease;
    z-index: 9999;
    will-change: opacity;
}

.drop-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drop-overlay.active .drop-overlay-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ---------- Card ---------- */
.drop-overlay-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: min(560px, 100%);
    padding: clamp(28px, 5vw, 48px) clamp(24px, 5vw, 56px);
    border-radius: 28px;
    border: 1.5px dashed rgba(255, 255, 255, 0.45);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(15, 23, 42, 0.78);
    color: #fff;
    text-align: center;
    box-shadow:
        0 24px 60px -12px rgba(0, 0, 0, 0.55),
        0 8px 24px -8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: scale(0.96) translateY(8px);
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease,
        border-color 0.2s ease;
    overflow: hidden;
}

/* Animated dashed border ring (decorative) */
.drop-overlay-content::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 22px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

/* Soft glow halo behind icon */
.drop-overlay-content::after {
    content: "";
    position: absolute;
    top: -40%;
    left: 50%;
    width: 120%;
    height: 70%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.35), transparent 65%);
    filter: blur(40px);
    pointer-events: none;
    opacity: 0.7;
    z-index: 0;
}

/* ---------- Icon ---------- */
.drop-overlay-content svg {
    position: relative;
    z-index: 1;
    width: clamp(56px, 10vw, 80px);
    height: clamp(56px, 10vw, 80px);
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 10px 30px -10px rgba(99, 102, 241, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    color: #fff;
    stroke-width: 2.2;
    animation: dropOverlayBob 2.4s ease-in-out infinite;
}

@keyframes dropOverlayBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* ---------- Typography ---------- */
.drop-overlay-content h3 {
    position: relative;
    z-index: 1;
    font-size: clamp(18px, 2.6vw, 24px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0;
    color: #fff;
    background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.82));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.drop-overlay-content h3:empty {
    display: none;
}

.drop-overlay-content p {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(13px, 1.6vw, 15px);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
    max-width: 42ch;
}

.drop-overlay-content p:empty {
    display: none;
}

/* =========================================================
   Light Mode
   ========================================================= */
@media (prefers-color-scheme: light) {
    .drop-overlay {
        background:
            radial-gradient(ellipse at top, rgba(99, 102, 241, 0.18), transparent 60%),
            radial-gradient(ellipse at bottom right, rgba(56, 189, 248, 0.18), transparent 60%),
            rgba(248, 250, 252, 0.65);
    }

    .drop-overlay-content {
        border-color: rgba(99, 102, 241, 0.45);
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
        color: #0f172a;
        box-shadow:
            0 24px 60px -12px rgba(15, 23, 42, 0.18),
            0 8px 24px -8px rgba(15, 23, 42, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .drop-overlay-content::before {
        border-color: rgba(99, 102, 241, 0.18);
    }

    .drop-overlay-content::after {
        background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.22), transparent 65%);
        opacity: 1;
    }

    .drop-overlay-content svg {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(56, 189, 248, 0.14));
        border-color: rgba(99, 102, 241, 0.3);
        color: #4338ca;
        box-shadow:
            0 10px 30px -10px rgba(99, 102, 241, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.7);
    }

    .drop-overlay-content h3 {
        color: #0f172a;
        background: linear-gradient(180deg, #0f172a, #334155);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .drop-overlay-content p {
        color: #475569;
    }
}

/* Explicit theme overrides (data-theme takes precedence over OS pref) */
[data-theme="light"] .drop-overlay {
    background:
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(56, 189, 248, 0.18), transparent 60%),
        rgba(248, 250, 252, 0.65);
}

[data-theme="light"] .drop-overlay-content {
    border-color: rgba(99, 102, 241, 0.45);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
    color: #0f172a;
    box-shadow:
        0 24px 60px -12px rgba(15, 23, 42, 0.18),
        0 8px 24px -8px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .drop-overlay-content::before {
    border-color: rgba(99, 102, 241, 0.18);
}

[data-theme="light"] .drop-overlay-content::after {
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.22), transparent 65%);
    opacity: 1;
}

[data-theme="light"] .drop-overlay-content svg {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(56, 189, 248, 0.14));
    border-color: rgba(99, 102, 241, 0.3);
    color: #4338ca;
    box-shadow:
        0 10px 30px -10px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .drop-overlay-content h3 {
    color: #0f172a;
    background: linear-gradient(180deg, #0f172a, #334155);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .drop-overlay-content p {
    color: #475569;
}

/* Dark theme explicit (matches default) */
[data-theme="dark"] .drop-overlay {
    background:
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(56, 189, 248, 0.14), transparent 60%),
        rgba(15, 23, 42, 0.55);
}

[data-theme="dark"] .drop-overlay-content {
    border-color: rgba(255, 255, 255, 0.45);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(15, 23, 42, 0.78);
    color: #fff;
    box-shadow:
        0 24px 60px -12px rgba(0, 0, 0, 0.55),
        0 8px 24px -8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .drop-overlay-content h3 {
    color: #fff;
    background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.82));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .drop-overlay-content p {
    color: rgba(255, 255, 255, 0.75);
}

/* =========================================================
   Responsive Breakpoints
   ========================================================= */

/* Tablet */
@media (max-width: 768px) {
    .drop-overlay {
        padding: 20px;
    }

    .drop-overlay-content {
        gap: 14px;
        border-radius: 24px;
    }

    .drop-overlay-content::before {
        inset: 6px;
        border-radius: 18px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .drop-overlay {
        padding: 16px;
        /* Lighter blur on small/low-power devices */
        backdrop-filter: blur(10px) saturate(130%);
        -webkit-backdrop-filter: blur(10px) saturate(130%);
    }

    .drop-overlay-content {
        gap: 12px;
        padding: 24px 20px;
        border-radius: 20px;
        width: 100%;
    }

    .drop-overlay-content::before {
        inset: 5px;
        border-radius: 16px;
    }

    .drop-overlay-content svg {
        padding: 12px;
        border-radius: 18px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .drop-overlay-content {
        padding: 20px 16px;
    }
}

/* Landscape phones — keep card compact vertically */
@media (max-height: 480px) and (orientation: landscape) {
    .drop-overlay-content {
        gap: 10px;
        padding: 18px 28px;
    }

    .drop-overlay-content svg {
        width: 48px;
        height: 48px;
        padding: 10px;
        animation: none;
    }

    .drop-overlay-content h3 {
        font-size: 17px;
    }

    .drop-overlay-content p {
        font-size: 13px;
    }
}

/* Ultra-wide / large displays — keep card from getting too large */
@media (min-width: 1600px) {
    .drop-overlay-content {
        width: min(640px, 100%);
    }
}

/* =========================================================
   Accessibility — Reduced Motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .drop-overlay,
    .drop-overlay-content {
        transition-duration: 0.01ms;
    }

    .drop-overlay-content svg {
        animation: none;
    }

    .drop-overlay.active .drop-overlay-content {
        transform: none;
    }
}

/* High-contrast / forced colors */
@media (forced-colors: active) {
    .drop-overlay-content {
        border: 2px dashed CanvasText;
        background: Canvas;
        color: CanvasText;
    }

    .drop-overlay-content svg {
        background: Canvas;
        border: 1px solid CanvasText;
        color: CanvasText;
        box-shadow: none;
    }

    .drop-overlay-content::after {
        display: none;
    }
}
