/* ============================================================
   Download Resources — Frontend Styles
   ============================================================ */

/* Wrapper */
.dr-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: relative;
}

/* ── Botón principal ── */
.dr-btn {
    display: inline-flex;
    align-items: center;
    gap: 0;
    position: relative;
    overflow: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background-color: #FFCE00;
    color: #1a1a1a;
    font-size: 15px;
    padding: 14px 28px;
    box-shadow: 0 4px 15px rgba(255, 206, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.dr-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 206, 0, 0.45);
}

.dr-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 206, 0, 0.2);
}

.dr-btn.dr-loading {
    pointer-events: none;
    opacity: 0.85;
}

.dr-btn.dr-success {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.35);
}

.dr-btn.dr-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.35);
    animation: dr-shake 0.4s ease;
}

/* Inner del botón */
.dr-btn-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

/* Ícono */
.dr-icon {
    display: flex;
    align-items: center;
    font-size: 1em;
    line-height: 1;
}

.dr-icon-left  { margin-right: 4px; }
.dr-icon-right { margin-left: 4px; }

/* ── Badge tipo de archivo ── */
.dr-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ffffff;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: none;
    line-height: 1.4;
}

/* ── Badge de puntos ── */
.dr-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background-color: #FFD700;
    color: #333333;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: dr-pulse-badge 2s infinite;
}

/* ── Barra de progreso ── */
.dr-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s;
}

.dr-btn.dr-loading .dr-progress-bar {
    opacity: 1;
}

.dr-progress-fill {
    height: 100%;
    width: 0%;
    background: rgba(255,255,255,0.9);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ── Toast notification ── */
.dr-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    min-width: 280px;
    max-width: 400px;
    background: #1a1a2e;
    color: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    transform: translateY(100px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: none;
}

.dr-toast.dr-toast-show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.dr-toast-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.dr-toast-content {
    flex: 1;
}

.dr-toast-title {
    font-weight: 700;
    margin-bottom: 2px;
    font-size: 15px;
}

.dr-toast-message {
    opacity: 0.8;
    font-size: 13px;
}

.dr-toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.dr-toast-close:hover { color: #fff; }

.dr-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6c63ff, #FFD700);
    border-radius: 0 0 12px 12px;
    width: 100%;
    animation: dr-toast-progress 4s linear forwards;
}

/* ── Placeholder en editor ── */
.dr-placeholder {
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    color: #999;
    background: #f9f9f9;
}

/* ── Animaciones ── */
@keyframes dr-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

@keyframes dr-pulse-badge {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4); }
    50%       { transform: scale(1.04); box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6); }
}

@keyframes dr-toast-progress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ── Icono de descarga (spinner) ── */
.dr-spin {
    display: inline-block;
    animation: dr-rotate 0.8s linear infinite;
}

@keyframes dr-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
