* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid #333;
}

.logo {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #888;
    font-weight: 300;
}

.gallery {
    padding: 60px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.artwork-card {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.artwork-card:hover {
    transform: translateY(-5px);
    border-color: #666;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.artwork-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
}

.artwork-info {
    padding: 20px;
}

.artwork-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.artwork-value {
    font-size: 0.9rem;
    color: #888;
    font-weight: 300;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: #fff;
    color: #000;
}

.hero-section {
    text-align: center;
    padding: 80px 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 200;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.hero-description {
    font-size: 1.1rem;
    color: #888;
    max-width: 600px;
    margin: 0 auto 40px;
}

.cta-button {
    background: #fff;
    color: #000;
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.cta-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.9rem;
}

/* Modal/Lightbox styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    margin: auto;
    display: block;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    margin-top: 5vh;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #bbb;
}

/* Modal controls */
.modal-controls {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 1002;
}

.modal-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
}

.modal-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.modal-btn.active:hover {
    background: #f0f0f0;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Enhanced card hover effects */
.artwork-card {
    cursor: pointer;
}

.artwork-card:hover .artwork-image img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Rarity badges */
.rarity-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 8px;
    background: #4a5568;
    color: #fff;
}

/* Smooth animations for filtering */
.artwork-card {
    animation: fadeIn 0.5s ease-in;
}

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

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    color: #000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .filters {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    /* Mobile-specific enhancements */
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 30px 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .hero-description {
        font-size: 1rem;
        margin: 0 auto 30px;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .gallery {
        padding: 40px 0;
    }
    
    .filters {
        margin-bottom: 30px;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 15px;
        font-size: 0.8rem;
        min-width: 60px;
    }
    
    .artwork-card {
        margin-bottom: 20px;
    }
    
    .artwork-image {
        height: 250px;
    }
    
    .artwork-info {
        padding: 15px;
    }
    
    .artwork-title {
        font-size: 1.1rem;
    }
    
    .artwork-value {
        font-size: 0.8rem;
    }
    
    .rarity-badge {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    
    /* Mobile modal adjustments */
    .modal-content {
        width: 95%;
        margin-top: 2vh;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .modal-controls {
        top: 10px;
        left: 10px;
        gap: 6px;
    }
    
    .modal-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .modal-info {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-description {
        font-size: 0.8rem;
    }
    
    /* Mobile social sharing */
    .social-share {
        top: 8px;
        right: 8px;
        gap: 6px;
    }
    
    .share-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* Mobile back to top */
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Mobile progress bar */
    .progress-bar {
        height: 2px;
    }
    
    /* Mobile loading spinner */
    .loading-spinner {
        width: 30px;
        height: 30px;
    }
    
    /* Mobile footer */
    footer {
        padding: 30px 0;
        font-size: 0.8rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    .filters {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
        min-width: 50px;
    }
    
    .artwork-image {
        height: 200px;
    }
    
    .artwork-info {
        padding: 12px;
    }
    
    .artwork-title {
        font-size: 1rem;
    }
    
    .share-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .gallery {
        padding: 30px 0;
    }
    
    .artwork-image {
        height: 180px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .artwork-card:hover {
        transform: none;
    }
    
    .artwork-card:active {
        transform: scale(0.98);
    }
    
    .filter-btn:hover {
        background: transparent;
        color: #fff;
    }
    
    .filter-btn:active {
        background: #fff;
        color: #000;
    }
    
    .share-btn:hover {
        transform: none;
    }
    
    .share-btn:active {
        transform: scale(0.9);
    }
    
    .back-to-top:hover {
        transform: none;
    }
    
    .back-to-top:active {
        transform: scale(0.95);
    }
}

/* Lazy loading styles */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.lazy-image.loaded {
    opacity: 1;
}

.lazy-placeholder {
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
}

/* Enhanced loading animation */
.loading-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

/* Intersection observer animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced card effects */
.artwork-card {
    position: relative;
    overflow: hidden;
}

.artwork-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.artwork-card:hover::before {
    left: 100%;
}

.artwork-image {
    position: relative;
    z-index: 2;
}

/* Social sharing buttons */
.social-share {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.artwork-card:hover .social-share {
    opacity: 1;
}

.share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.share-btn.twitter { background: #1da1f2; color: white; }
.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.copy { background: #333; color: white; }

.share-btn:hover {
    transform: scale(1.1);
}

/* Enhanced rarity badges with glow */
.rarity-badge {
    position: relative;
    overflow: hidden;
}

/* Enhanced search with suggestions */
.search-container {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggestion-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #333;
}

/* Keyboard navigation */
.artwork-card:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Enhanced modal with info */
.modal-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    padding: 15px;
    border-radius: 10px;
    color: white;
    backdrop-filter: blur(10px);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.modal-description {
    font-size: 0.9rem;
    color: #ccc;
}

/* Progress bar for loading */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #fff, #666);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Enhanced filter buttons */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .artwork-card {
        border: 2px solid #fff;
    }
    
    .filter-btn {
        border: 2px solid #fff;
    }
}
