/* Popular Images Page Styles */

/* Hero Section */
.popular-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(to bottom, #fff, #fff5f5);
}

.popular-hero h1 {
    font-size: 2em;
    color: #333;
    margin: 0 0 15px;
}

.popular-hero .hero-description {
    font-size: 1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Image Gallery */
.image-gallery {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Featured Image (First Image) */
.image-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 768px) {
    .image-card.featured {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Image Card */
.image-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.image-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Anti-scraping protection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.image-card:hover .image-wrapper img {
    transform: scale(1.05);
}

/* New Badge */
.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Image Info */
.image-info {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-tag {
    background: #f0f0f0;
    color: #555;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
}

.comment-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 0.85rem;
}

.comment-count svg {
    width: 14px;
    height: 14px;
}

/* No Images Message */
.no-images {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-size: 1.1rem;
}

/* App Download Section */
.app-download-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(to top, #ffe4e1, #fff);
    margin-top: 40px;
}

.app-download-section h2 {
    font-size: 1.5em;
    color: #333;
    margin: 0 0 15px;
}

.app-download-section > p {
    color: #666;
    margin: 0 0 25px;
    line-height: 1.6;
}

/* Footer Navigation */
.footer-nav {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-nav a {
    color: #bbb;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .popular-hero h1 {
        font-size: 1.5em;
    }

    .popular-hero .hero-description {
        font-size: 0.9rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .image-info {
        padding: 8px 10px;
    }

    .category-tag {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .app-download-section h2 {
        font-size: 1.2em;
    }
}

@media (max-width: 400px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal *,
.modal *::before,
.modal *::after {
    box-sizing: border-box;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 400px;
    width: calc(100% - 40px);
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 40px 30px 30px;
    text-align: center;
}

.modal-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.modal-body h3 {
    font-size: 1.3em;
    color: #333;
    margin: 0 0 12px;
}

.modal-body > p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 20px;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px;
    text-align: left;
}

.modal-features li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9rem;
}

.modal-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    border-radius: 50%;
}

.modal-features li::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

.modal-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #34a853, #2d9248);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.modal-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 168, 83, 0.4);
}

.modal-download-btn img {
    width: 24px;
    height: 24px;
}

/* Modal Responsive */
@media (max-width: 400px) {
    .modal-body {
        padding: 35px 20px 25px;
    }

    .modal-body h3 {
        font-size: 1.2em;
    }

    .modal-features li {
        font-size: 0.85rem;
    }

    .modal-download-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}
