/* ═══════════════════════════════════════════════════════════════
   Download Modal — Ultra Minimalist Design
   assets/css/download-modal.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ──────────────────────────────────────────────────── */
.dl-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 11000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.dl-modal-overlay.open {
    display: flex;
    animation: dlOverlayIn 0.2s ease;
}
@keyframes dlOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Container ─────────────────────────────────────────── */
.dl-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: dlModalIn 0.2s ease-out;
    border: 1px solid #e5e7eb;
}
@keyframes dlModalIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar styling */
.dl-modal::-webkit-scrollbar { width: 4px; }
.dl-modal::-webkit-scrollbar-track { background: transparent; }
.dl-modal::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }

/* ── Header ──────────────────────────────────────────────────── */
.dl-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}
.dl-modal-icon {
    width: 44px;
    height: 44px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #111827;
}
.dl-modal-icon i {
    font-size: 18px;
}
.dl-modal-title-wrap {
    flex: 1;
    min-width: 0;
}
.dl-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dl-modal-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}
.dl-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.dl-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ── Meta Info Bar ───────────────────────────────────────────── */
.dl-modal-meta {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
}
.dl-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
}
.dl-meta-item i {
    color: #9ca3af;
}
.dl-meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d1d5db;
}

/* ── Loading State ───────────────────────────────────────────── */
.dl-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px 24px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}
.dl-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid #e5e7eb;
    border-top-color: #111827;
    border-radius: 50%;
    animation: dlSpin 0.8s linear infinite;
}
@keyframes dlSpin {
    to { transform: rotate(360deg); }
}

/* ── Parts List ──────────────────────────────────────────────── */
.dl-parts-list {
    padding: 12px 24px;
    max-height: 320px;
    overflow-y: auto;
}
.dl-part-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.dl-part-item:last-child {
    border-bottom: none;
}
.dl-part-icon {
    width: 36px;
    height: 36px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dl-part-icon i {
    font-size: 14px;
    color: #4b5563;
}
.dl-part-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.dl-part-label {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}
.dl-part-size {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}
.dl-part-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #111827;
    transition: all 0.2s;
    flex-shrink: 0;
}
.dl-part-btn:hover {
    background: #111827;
    border-color: #111827;
    color: #fff;
}
.dl-part-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* İndirilmiş part stili */
.dl-part-item.dl-downloaded {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.dl-part-item.dl-downloaded .dl-part-icon {
    color: #059669;
}
.dl-part-btn.dl-part-done {
    background: #ecfdf5;
    border-color: #10b981;
    cursor: default;
    opacity: 1;
}
body.dark-theme .dl-part-item.dl-downloaded {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.3);
}
body.dark-theme .dl-part-btn.dl-part-done {
    background: rgba(16,185,129,0.15);
    border-color: #10b981;
}

/* ── Actions ─────────────────────────────────────────────────── */
.dl-modal-actions {
    display: none;
    padding: 24px;
}
.dl-btn-all {
    width: 100%;
    padding: 12px;
    background: #111827;
    border: 1px solid #111827;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.dl-btn-all:hover {
    background: #374151;
    border-color: #374151;
}
.dl-btn-all:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   Dark Theme
   ═══════════════════════════════════════════════════════════════ */
body.dark-theme .dl-modal {
    background: #18191a;
    border-color: #3a3b3c;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
body.dark-theme .dl-modal-header {
    border-color: #3a3b3c;
}
body.dark-theme .dl-modal-icon {
    background: #242526;
    color: #e4e6eb;
}
body.dark-theme .dl-modal-title {
    color: #e4e6eb;
}
body.dark-theme .dl-modal-subtitle, body.dark-theme .dl-modal-close {
    color: #b0b3b8;
}
body.dark-theme .dl-modal-close:hover {
    background: #3a3b3c;
    color: #e4e6eb;
}
body.dark-theme .dl-modal-meta {
    background: #242526;
    border-color: #3a3b3c;
}
body.dark-theme .dl-meta-item {
    color: #e4e6eb;
}
body.dark-theme .dl-meta-item i, body.dark-theme .dl-meta-divider {
    color: #b0b3b8;
    background: #4e4f50;
}
body.dark-theme .dl-modal-loading {
    color: #b0b3b8;
}
body.dark-theme .dl-spinner {
    border-color: #3a3b3c;
    border-top-color: #e4e6eb;
}
body.dark-theme .dl-part-item {
    border-color: #3a3b3c;
}
body.dark-theme .dl-part-icon {
    background: #242526;
    border-color: #3a3b3c;
}
body.dark-theme .dl-part-icon i {
    color: #e4e6eb;
}
body.dark-theme .dl-part-label {
    color: #e4e6eb;
}
body.dark-theme .dl-part-size {
    color: #b0b3b8;
}
body.dark-theme .dl-part-btn {
    border-color: #3a3b3c;
    background: transparent;
    color: #e4e6eb;
}
body.dark-theme .dl-part-btn:hover {
    background: #e4e6eb;
    border-color: #e4e6eb;
    color: #18191a;
}
body.dark-theme .dl-btn-all {
    background: #e4e6eb;
    border-color: #e4e6eb;
    color: #18191a;
}
body.dark-theme .dl-btn-all:hover {
    background: #d8dadd;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 520px) {
    .dl-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        border: none;
        max-height: 90vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        animation: dlModalMobileIn 0.25s ease;
    }
    @keyframes dlModalMobileIn {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .dl-modal-overlay.open {
        align-items: flex-end;
        padding: 0;
    }
    .dl-modal-header {
        padding: 20px 24px;
    }
}
