/* Download Popup Styles */
.download-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.download-popup-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px; /* Reduced from 600px */
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

.download-popup-header {
    text-align: center;
    margin-bottom: 1.5rem; /* Reduced from 2rem */
}

.download-popup-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.5rem;
}

.download-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Reduced from 250px */
    gap: 1rem; /* Reduced from 1.5rem */
    margin: 1.5rem 0; /* Reduced from 2rem */
}

.download-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem; /* Reduced from 1.5rem */
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    min-height: 220px; /* Fixed height for consistency */
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #AC5512;
}

.download-card-icon {
    font-size: 2rem; /* Reduced from 2.5rem */
    margin-bottom: 0.75rem; /* Reduced from 1rem */
}

.download-card h4 {
    color: #333;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem; /* Reduced from 1.2rem */
    min-height: 2.2rem; /* Fixed height for title */
}

.download-card p {
    color: #666;
    font-size: 0.85rem; /* Reduced from 0.9rem */
    margin: 0 0 1rem 0;
    line-height: 1.4;
    flex-grow: 1; /* Allow paragraph to grow */
    min-height: 2.8rem; /* Fixed height for description */
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #AC5512, #8a4510);
    color: white;
    padding: 0.65rem 1.25rem; /* Reduced from 0.75rem 1.5rem */
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 0.95rem; /* Reduced from 1rem */
    box-sizing: border-box; /* Ensure padding is included in width */
    max-width: 180px; /* Limit button width */
    margin: 0 auto; /* Center button */
}

.btn-download:hover {
    background: linear-gradient(135deg, #8a4510, #6a3510);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(172, 85, 18, 0.3);
}

.download-icon {
    font-size: 1.1rem; /* Reduced from 1.2rem */
}

.download-popup-footer {
    margin-top: 1.5rem; /* Reduced from 2rem */
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem; /* Reduced from 0.95rem */
    margin: 0;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    display: inline-block;
    width: 18px; /* Reduced from 20px */
    height: 18px; /* Reduced from 20px */
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 0.5rem; /* Reduced from 0.75rem */
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container input:checked + .checkmark {
    background: #AC5512;
    border-color: #AC5512;
}

.checkbox-container input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px; /* Reduced from 14px */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-container:hover .checkmark {
    border-color: #AC5512;
}

/* Fix for body scroll when popup is open */
body.popup-open {
    overflow: hidden;
    height: 100vh;
}

/* Ensure popup is above everything */
.download-popup-overlay {
    z-index: 10000 !important;
}

/* Ensure popup content doesn't affect body scroll */
.download-popup-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .download-popup-content {
        padding: 1.5rem;
        width: 95%;
        max-width: 350px; /* Smaller on mobile */
    }
    
    .download-options {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .download-popup-header h3 {
        font-size: 1.3rem;
    }
    
    .download-card {
        padding: 1rem;
        min-height: 200px;
    }
    
    .download-card h4 {
        font-size: 1rem;
    }
    
    .download-card p {
        font-size: 0.8rem;
    }
    
    .btn-download {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        max-width: 160px;
    }
}

@media (max-width: 480px) {
    .download-popup-content {
        padding: 1.25rem;
    }
    
    .download-card {
        min-height: 180px;
    }
    
    .download-card-icon {
        font-size: 1.75rem;
    }
}