/* =============================================================
   Insta MP3 Dropper — Responsive Styles
   ============================================================= */

/* ── Reset & Base ───────────────────────────────────────────── */
.imd-wrap *,
.imd-wrap *::before,
.imd-wrap *::after {
    box-sizing: border-box;
}

/* ── Hidden fix — CSS se override na ho ────────────────────── */
[hidden],
.imd-wrap [hidden] {
    display: none !important;
}

/* ── CSS Variables ──────────────────────────────────────────── */
.imd-wrap {
    --imd-green:      #16a34a;
    --imd-green-dark: #15803d;
    --imd-card:       #ffffff;
    --imd-border:     rgba(15,23,42,.12);
    --imd-text:       #0f172a;
    --imd-muted:      #64748b;
    --imd-radius:     14px;
    --imd-shadow:     0 4px 16px rgba(15,23,42,.08);

    font-family: 'Segoe UI', system-ui, sans-serif;
    color:       var(--imd-text);
    width:       100%;
    max-width:   780px;
    margin:      0 auto;
    padding:     24px 16px 48px;
}

/* ── Card ───────────────────────────────────────────────────── */
.imd-card {
    background:    var(--imd-card);
    border:        1px solid var(--imd-border);
    border-radius: var(--imd-radius);
    box-shadow:    var(--imd-shadow);
    padding:       20px;
    margin-bottom: 24px;
    width:         100%;
}

/* ── Input Row ──────────────────────────────────────────────── */
.imd-input-row {
    display:   flex;
    gap:       10px;
    flex-wrap: wrap;
    align-items: stretch;
}

.imd-url-input {
    flex:          1 1 200px;
    min-width:     0;
    background:    #f1f5f9;
    border:        1px solid rgba(15,23,42,.14);
    border-radius: 9px;
    color:         var(--imd-text);
    font-size:     1rem;
    padding:       12px 14px;
    outline:       none;
    transition:    border-color .2s, box-shadow .2s;
    width:         100%;
}
.imd-url-input::placeholder { color: var(--imd-muted); opacity: .7; }
.imd-url-input:focus {
    border-color: var(--imd-green);
    box-shadow:   0 0 0 3px rgba(22,163,74,.12);
    background:   #fff;
}

/* ── Button ─────────────────────────────────────────────────── */
.imd-btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    gap:             7px;
    font-size:       .95rem;
    font-weight:     600;
    padding:         12px 22px;
    border-radius:   9px;
    border:          none;
    cursor:          pointer;
    text-decoration: none;
    white-space:     nowrap;
    transition:      background .18s, transform .12s, box-shadow .18s;
    line-height:     1;
}

.imd-btn-primary {
    background: var(--imd-green);
    color:      #fff;
    box-shadow: 0 2px 8px rgba(22,163,74,.25);
    flex-shrink: 0;
}
.imd-btn-primary:hover  { background: var(--imd-green-dark); transform: translateY(-1px); }
.imd-btn-primary:active { transform: translateY(0); }
.imd-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.imd-btn-success {
    display:      block;
    width:        100%;
    text-align:   center;
    background:   var(--imd-green);
    color:        #fff !important;
    padding:      13px 20px;
    border-radius: 9px;
    text-decoration: none;
    font-weight:  600;
    font-size:    1rem;
    transition:   background .2s;
    border:       none;
    cursor:       pointer;
}
.imd-btn-success:hover { background: var(--imd-green-dark); color: #fff !important; }

/* ── Error Message ──────────────────────────────────────────── */
.imd-error-msg {
    margin-top:    10px;
    font-size:     .88rem;
    color:         #dc2626;
    background:    rgba(220,38,38,.06);
    border:        1px solid rgba(220,38,38,.20);
    border-radius: 8px;
    padding:       9px 14px;
    width:         100%;
}

/* ── Loading ────────────────────────────────────────────────── */
.imd-loading {
    display:     flex;
    align-items: center;
    gap:         12px;
    padding:     20px 4px;
    font-size:   .95rem;
    color:       var(--imd-muted);
    flex-direction: column;
}

.imd-spinner {
    width:         26px;
    height:        26px;
    min-width:     26px;
    border:        3px solid #e5e7eb;
    border-top-color: var(--imd-green);
    border-radius: 50%;
    animation:     imd-spin .7s linear infinite;
}

@keyframes imd-spin { to { transform: rotate(360deg); } }

/* ── Result Card ────────────────────────────────────────────── */
.imd-result-inner {
    display:        flex;
    flex-direction: column;
    gap:            14px;
    align-items:    stretch;
}

.imd-ready-text {
    font-size:   1.05rem;
    font-weight: 600;
    color:       var(--imd-green);
    margin:      0;
    text-align:  center;
}

#imd-audio-player {
    width:         100%;
    border-radius: 8px;
    display:       block;
}

/* ── How-to Steps ───────────────────────────────────────────── */
.imd-steps {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    gap:                   14px;
    margin-bottom:         24px;
    width:                 100%;
}

.imd-step {
    background:    var(--imd-card);
    border:        1px solid var(--imd-border);
    border-radius: var(--imd-radius);
    padding:       20px 14px;
    text-align:    center;
    transition:    border-color .2s, transform .2s, box-shadow .2s;
}
.imd-step:hover {
    border-color: rgba(22,163,74,.30);
    transform:    translateY(-3px);
    box-shadow:   0 6px 20px rgba(15,23,42,.08);
}

.imd-step-icon {
    width:           44px;
    height:          44px;
    background:      rgba(22,163,74,.10);
    border-radius:   50%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    margin:          0 auto 12px;
    color:           var(--imd-green);
}
.imd-step-icon svg { width: 20px; height: 20px; }

.imd-step h3 {
    font-size:   .9rem;
    font-weight: 700;
    margin:      0 0 6px;
    color:       var(--imd-text);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.imd-step p {
    font-size:   .82rem;
    color:       var(--imd-muted);
    margin:      0;
    line-height: 1.5;
}

/* ── Tablet (max 640px) ─────────────────────────────────────── */
@media (max-width: 640px) {

    .imd-wrap {
        padding: 16px 12px 40px;
    }

    /* Input: URL full width, button full width below */
    .imd-input-row {
        flex-direction: column;
        gap: 10px;
    }
    .imd-url-input {
        flex: none;
        width: 100%;
    }
    .imd-btn-primary {
        width: 100%;
        padding: 13px;
        font-size: 1rem;
    }

    /* Steps: single column on mobile */
    .imd-steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .imd-step {
        display:     flex;
        align-items: center;
        gap:         14px;
        text-align:  left;
        padding:     16px;
        flex-direction: column;
    }
    .imd-step-icon {
        margin: 0;
        flex-shrink: 0;
    }
    .imd-step-content { flex: 1; }
    .imd-step h3 { margin-bottom: 3px; }

    /* Card padding reduce */
    .imd-card {
        padding: 16px;
    }
}

/* ── Very small phones (max 380px) ─────────────────────────── */
@media (max-width: 380px) {
    .imd-wrap {
        padding: 12px 10px 32px;
    }
    .imd-url-input {
        font-size: .9rem;
        padding:   10px 12px;
    }
    .imd-btn-primary {
        font-size: .9rem;
        padding:   11px;
    }
}