/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #8B5CF6 0%, #9333EA 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    opacity: 0.8;
}

.nav-link.external-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-link.highlight {
    background: rgba(255,255,255,0.25);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.nav-link.highlight:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    width: 250px;
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 80px;
    z-index: 100;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #8B5CF6;
    background: white;
    color: #8B5CF6;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    background: #F9FAFB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #9333EA 100%);
    color: white;
    border-color: #8B5CF6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* Main Gallery */
.main {
    padding: 2rem 0;
    min-height: 500px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.5s ease;
}

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

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(139, 92, 246, 0.08);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(139, 92, 246, 0.15);
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8fafc;
}

.gallery-content {
    padding: 1rem;
}

.gallery-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-category {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: linear-gradient(135deg, #8B5CF6 0%, #9333EA 100%);
    color: white;
    border-radius: 18px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.2);
}

.gallery-prompt {
    font-size: 0.9rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: #8B5CF6;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: #333;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.close:hover {
    background: #f0f0f0;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.modal-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.modal-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.category-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
}

.modal-prompt h4 {
    margin-bottom: 0.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-prompt pre {
    background: #fafbfc;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.copy-btn {
    background: linear-gradient(135deg, #8B5CF6 0%, #9333EA 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #6B21A8 0%, #9333EA 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    opacity: 0.8;
}

.footer-link-highlight {
    background: rgba(255,255,255,0.2) !important;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.footer-link-highlight:hover {
    background: rgba(255,255,255,0.25) !important;
    transform: translateY(-2px);
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cta-button.primary {
    background: white;
    color: #f5576c;
}

.cta-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    background: #f8f8f8;
}

.cta-button.secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
}

.cta-button.secondary:hover {
    background: rgba(255,255,255,0.3);
    border-color: white;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .search-box input {
        width: 200px;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .stats {
        gap: 2rem;
    }

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

    .modal-body {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .filter-btn {
        flex-shrink: 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-button {
        width: 200px;
        justify-content: center;
    }

    .nav-link.highlight {
        background: rgba(255,255,255,0.3);
        margin: 0.2rem;
    }
}

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

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #8B5CF6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7C3AED;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #8B5CF6 0%, #9333EA 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.25);
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 3000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

/* Dark Mode Styles */
[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

[data-theme="dark"] body {
    background-color: #1a1a1a;
}

[data-theme="dark"] .header {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

[data-theme="dark"] .filter-section {
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
}

[data-theme="dark"] .gallery-item {
    background: #2d2d2d;
    border: 1px solid #404040;
}

[data-theme="dark"] .gallery-title {
    color: #e0e0e0;
}

[data-theme="dark"] .gallery-prompt {
    color: #b0b0b0;
}

[data-theme="dark"] .modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] .modal-prompt pre {
    background: #1a1a1a;
    border: 1px solid #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .modal-prompt h4 {
    color: #e0e0e0;
}

[data-theme="dark"] .modal-prompt p {
    color: #b0b0b0;
}

[data-theme="dark"] .modal-image {
    background: #1a1a1a;
}

[data-theme="dark"] .footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

[data-theme="dark"] .search-box input {
    background: rgba(255,255,255,0.1);
    color: white;
}

[data-theme="dark"] .search-box input::placeholder {
    color: rgba(255,255,255,0.6);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #8B5CF6 0%, #9333EA 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.theme-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Language Toggle Button */
.lang-toggle {
    position: fixed;
    top: calc(50% + 70px);
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #8B5CF6 0%, #9333EA 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.lang-toggle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.lang-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

[data-theme="dark"] .lang-toggle {
    background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Hide elements with data-lang attribute */
[data-lang="en"] [data-lang="zh"],
[data-lang="zh"] [data-lang="en"] {
    display: none !important;
}

/* Mobile responsive for toggle buttons */
@media (max-width: 768px) {
    .theme-toggle,
    .lang-toggle {
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .lang-toggle {
        top: calc(50% + 60px);
    }
}