/* Download Modal Styles */

.download-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.download-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.download-modal {
    background: var(--bg-secondary, #12121a);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 24px;
    padding: 32px;
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.download-modal-overlay.active .download-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.download-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.download-modal-title {
    font-family: "Syne", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    display: flex;
    align-items: center;
    gap: 12px;
}

.download-modal-title svg {
    width: 24px;
    height: 24px;
    fill: var(--accent-primary, #ff6b35);
}

.download-modal-close {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary, #1a1a25);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.download-modal-close:hover {
    background: var(--accent-primary, #ff6b35);
}

.download-modal-close svg {
    width: 18px;
    height: 18px;
    fill: var(--text-secondary, #a0a0b0);
    transition: fill 0.2s ease;
}

.download-modal-close:hover svg {
    fill: white;
}

/* Option Groups */
.download-option-group {
    margin-bottom: 24px;
}

.download-option-label {
    font-family: "Outfit", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #606070);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
    display: block;
}

/* Resolution Cards */
.resolution-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.resolution-card {
    background: var(--bg-primary, #0a0a0f);
    border: 2px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resolution-card:hover {
    border-color: var(--accent-primary, #ff6b35);
    background: rgba(255, 107, 53, 0.05);
}

.resolution-card.selected {
    border-color: var(--accent-primary, #ff6b35);
    background: rgba(255, 107, 53, 0.1);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
}

.resolution-card-name {
    font-family: "Syne", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 4px;
}

.resolution-card-size {
    font-family: "Outfit", sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted, #606070);
}

.resolution-card.selected .resolution-card-name,
.resolution-card.selected .resolution-card-size {
    color: var(--accent-primary, #ff6b35);
}

/* Format Options */
.format-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.format-card {
    background: var(--bg-primary, #0a0a0f);
    border: 2px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 14px;
}

.format-card:hover {
    border-color: var(--accent-primary, #ff6b35);
    background: rgba(255, 107, 53, 0.05);
}

.format-card.selected {
    border-color: var(--accent-primary, #ff6b35);
    background: rgba(255, 107, 53, 0.1);
}

.format-card-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary, #1a1a25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.format-card.selected .format-card-icon {
    background: var(--accent-primary, #ff6b35);
}

.format-card-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--text-muted, #606070);
    transition: fill 0.2s ease;
}

.format-card.selected .format-card-icon svg {
    fill: white;
}

.format-card-info {
    flex: 1;
}

.format-card-name {
    font-family: "Syne", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.format-card-desc {
    font-family: "Outfit", sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted, #606070);
    margin-top: 2px;
}

/* DPI Slider */
.dpi-container {
    background: var(--bg-primary, #0a0a0f);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 18px;
}

.dpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.dpi-label {
    font-family: "Outfit", sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0b0);
}

.dpi-value {
    font-family: "Syne", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary, #ff6b35);
}

.dpi-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary, #1a1a25);
    border-radius: 4px;
    outline: none;
}

.dpi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--accent-primary, #ff6b35);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.4);
    transition: transform 0.2s ease;
}

.dpi-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.dpi-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--accent-primary, #ff6b35);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.4);
}

.dpi-presets {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.dpi-preset {
    font-size: 0.7rem;
    color: var(--text-muted, #606070);
    cursor: pointer;
    transition: color 0.2s ease;
}

.dpi-preset:hover {
    color: var(--accent-primary, #ff6b35);
}

/* Info Box */
.download-info {
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.download-info-icon {
    flex-shrink: 0;
    font-size: 1.2rem;
}

.download-info-text {
    font-family: "Outfit", sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
    line-height: 1.5;
}

.download-info-text strong {
    color: var(--accent-primary, #ff6b35);
}

/* Download Button */
.download-modal-btn {
    width: 100%;
    padding: 18px 24px;
    font-family: "Syne", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
    background: linear-gradient(135deg, var(--accent-primary, #ff6b35) 0%, var(--accent-secondary, #f7931e) 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--accent-glow, rgba(255, 107, 53, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.download-modal-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-glow, rgba(255, 107, 53, 0.4));
}

.download-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.download-modal-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.download-modal-btn.loading {
    pointer-events: none;
}

.download-modal-btn .btn-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* SVG note */
.svg-note {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-muted, #606070);
    display: none;
}

.svg-note.visible {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 500px) {
    .download-modal {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .download-modal-title {
        font-size: 1.2rem;
    }

    .resolution-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .resolution-card {
        padding: 14px 10px;
    }

    .format-options {
        grid-template-columns: 1fr;
    }

    .format-card {
        padding: 14px;
    }

    .download-modal-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }
}

/* Touch-friendly */
@media (pointer: coarse) {
    .resolution-card,
    .format-card {
        min-height: 48px;
    }

    .dpi-slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }
}