/* Gallery Page Specific Styles */

.gallery-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
}

/* Gallery Header */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.back-button {
    background: white;
    color: #764ba2;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.gallery-title-section {
    flex: 1;
    text-align: center;
}

.gallery-main-title {
    font-size: 2.5rem;
    color: white;
    text-shadow:
        3px 3px 0 #ff1493,
        6px 6px 0 #00bfff;
    margin-bottom: 10px;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.trophy-button {
    background: linear-gradient(135deg, #ffd93d, #ffb347);
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.4);
    transition: all 0.3s ease;
}

.trophy-button:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 6px 20px rgba(255, 217, 61, 0.6);
}

.trophy-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 20px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    flex: 1;
    min-width: 150px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #9d4edd;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.5rem;
    color: white;
    padding: 60px;
}

.artwork-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

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

.artwork-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.artwork-card:active {
    transform: translateY(-5px) scale(1.01);
}

.artwork-thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: #f0f0f0;
    overflow: hidden;
}

.artwork-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.artwork-card:hover .artwork-thumbnail {
    transform: scale(1.1);
}

.artwork-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff1493;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 20, 147, 0.5);
}

.artwork-info {
    padding: 20px;
}

.artwork-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 12px;
    font-weight: bold;
    line-height: 1.3;
}

.artwork-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.artwork-reward {
    font-size: 0.85rem;
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    padding: 6px 12px;
    border-radius: 15px;
    display: inline-block;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.artwork-like-btn {
    background: linear-gradient(135deg, #ff6b9d, #ff1493);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(255, 20, 147, 0.3);
    flex-shrink: 0;
    white-space: nowrap;
}

.artwork-like-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.5);
}

.artwork-like-btn:active {
    transform: scale(1.02);
}

.artwork-like-btn.liked {
    animation: heartPop 0.4s ease;
}

@keyframes heartPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.artwork-likes {
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.hidden {
    display: none;
}

.lightbox-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.lightbox-image-container {
    position: relative;
    flex: 2;
    min-width: 400px;
    cursor: zoom-in;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.lightbox-image-container:hover .lightbox-image {
    transform: scale(1.02);
}

.zoom-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.lightbox-image-container:hover .zoom-hint {
    opacity: 1;
}

.zoom-icon {
    font-size: 1.2rem;
    animation: zoomPulse 2s ease-in-out infinite;
}

@keyframes zoomPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.lightbox-info {
    flex: 1;
    color: white;
    min-width: 280px;
}

.lightbox-info h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #ffd93d;
}

.lightbox-info p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.lightbox-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.like-btn {
    background: linear-gradient(135deg, #ff6b9d, #ff1493);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 20, 147, 0.4);
    transition: all 0.3s ease;
    font-weight: bold;
}

.like-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(255, 20, 147, 0.6);
}

.like-btn:active {
    transform: scale(1.05);
}

.like-btn.liked {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.25); }
}

.heart {
    margin-right: 8px;
}

.reward-display {
    background: linear-gradient(135deg, #ffd93d, #ffb347);
    padding: 15px 25px;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    box-shadow: 0 5px 20px rgba(255, 217, 61, 0.4);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Trophy Wall Modal */
.trophy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.trophy-modal.hidden {
    display: none;
}

.trophy-modal-content {
    background: white;
    border-radius: 25px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.trophy-modal-content h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #9d4edd;
    margin-bottom: 30px;
}

.trophy-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 3rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.trophy-close:hover {
    color: #ff1493;
}

.trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.trophy-item {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.trophy-item:hover {
    transform: translateY(-5px) rotate(2deg);
}

.trophy-item.locked {
    background: #e0e0e0;
    opacity: 0.5;
}

.trophy-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.trophy-name {
    font-size: 0.9rem;
    color: #333;
    font-weight: bold;
}

.no-trophies {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    padding: 40px;
}

.trophy-reset {
    width: 100%;
    background: #ff1493;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trophy-reset:hover {
    background: #d01080;
    transform: scale(1.05);
}

/* Fullscreen Image Viewer */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

.fullscreen-viewer.hidden {
    display: none;
}

.fullscreen-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 100px rgba(255, 255, 255, 0.3);
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10003;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.fullscreen-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Challenge Progress - Compact & Subtle */
.challenge-progress {
    margin-top: 15px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.challenge-progress h3 {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.challenge-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    margin: 3px 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.challenge-item.completed {
    background: rgba(107, 207, 127, 0.15);
    border-left-color: #6bcf7f;
}

.challenge-item.in-progress {
    background: rgba(255, 217, 61, 0.15);
    border-left-color: #ffd93d;
}

.challenge-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.challenge-reward {
    font-size: 0.9rem;
    opacity: 0.8;
}

.challenge-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
}

.challenge-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6bcf7f, #4d96ff);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 10002;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-main-title {
        font-size: 1.8rem;
    }

    .gallery-header {
        flex-direction: column;
    }

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

    /* Mobile artwork card optimizations */
    .artwork-info {
        padding: 15px;
    }

    .artwork-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .artwork-bottom-row {
        gap: 8px;
    }

    .artwork-reward {
        font-size: 0.8rem;
        padding: 5px 10px;
        max-width: 55%;
    }

    .artwork-like-btn {
        padding: 5px 12px;
        font-size: 0.85rem;
        gap: 4px;
    }

    .artwork-likes {
        font-size: 0.85rem;
    }

    /* Lightbox mobile fixes */
    .lightbox {
        padding: 10px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .lightbox-content {
        flex-direction: column;
        gap: 15px;
        margin-top: 60px;
        margin-bottom: 20px;
    }

    .lightbox-image-container {
        min-width: 100%;
        width: 100%;
    }

    .lightbox-image {
        max-height: 60vh;
        width: 100%;
        object-fit: contain;
    }

    .lightbox-info {
        min-width: 100%;
        width: 100%;
    }

    .lightbox-info h2 {
        font-size: 1.5rem;
    }

    .lightbox-info p {
        font-size: 1rem;
    }

    /* Navigation buttons - positioned better for mobile */
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 2.5rem;
        padding: 5px 15px;
        z-index: 10005;
        background: rgba(255, 255, 255, 0.3) !important;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 2.5rem;
        padding: 8px 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10005;
        background: rgba(255, 255, 255, 0.3) !important;
        border: 2px solid rgba(255, 255, 255, 0.5);
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-prev:hover,
    .lightbox-next:hover {
        transform: translateY(-50%) scale(1.05);
        background: rgba(255, 255, 255, 0.5) !important;
    }

    /* Like button and actions */
    .like-btn {
        padding: 12px 24px;
        font-size: 1.1rem;
    }

    .reward-display {
        padding: 10px 20px;
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }

    .lightbox-actions {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    /* Fullscreen viewer mobile */
    .fullscreen-viewer {
        padding: 0;
    }

    .fullscreen-image {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .fullscreen-close {
        top: 10px;
        right: 10px;
        font-size: 2.5rem;
        padding: 5px 15px;
    }

    .fullscreen-hint {
        bottom: 15px;
        font-size: 0.9rem;
    }

    /* Zoom hint smaller on mobile */
    .zoom-hint {
        font-size: 0.8rem;
        padding: 8px 15px;
        bottom: 10px;
    }

    /* Challenge progress mobile */
    .challenge-progress {
        padding: 10px;
    }

    .challenge-progress h3 {
        font-size: 0.75rem;
    }

    .challenge-name {
        font-size: 0.75rem;
    }

    /* Stats bar mobile */
    .stats-bar {
        gap: 10px;
    }

    .stat-item {
        padding: 15px 20px;
        min-width: 120px;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    /* Trophy modal mobile */
    .trophy-modal {
        padding: 10px;
    }

    .trophy-modal-content {
        padding: 25px 15px;
        max-height: 90vh;
    }

    .trophy-modal-content h2 {
        font-size: 1.8rem;
    }
}

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

    .gallery-main-title {
        font-size: 1.5rem;
    }

    .trophy-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    /* Extra small mobile - compact card layout */
    .artwork-info {
        padding: 12px;
    }

    .artwork-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .artwork-bottom-row {
        gap: 6px;
        margin-top: 6px;
    }

    .artwork-reward {
        font-size: 0.75rem;
        padding: 4px 8px;
        border-radius: 12px;
        max-width: 50%;
    }

    .artwork-like-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
        gap: 3px;
    }

    .artwork-likes {
        font-size: 0.8rem;
    }

    /* Extra small screens - make controls even more compact */
    .lightbox {
        padding: 5px;
    }

    .lightbox-content {
        margin-top: 50px;
    }

    .lightbox-image {
        max-height: 50vh;
    }

    .lightbox-close {
        font-size: 2rem;
        padding: 5px 12px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
        padding: 5px 10px;
    }

    .lightbox-info h2 {
        font-size: 1.3rem;
    }

    .lightbox-info p {
        font-size: 0.95rem;
    }

    .like-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .reward-display {
        font-size: 0.9rem;
        padding: 8px 15px;
    }
}
