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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --accent: #4a9eff;
    --accent-hover: #3d8fef;
    --border: #333333;
    --shadow: rgba(0, 0, 0, 0.5);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
}

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

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

.title {
    font-size: 3rem;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.title:hover {
    transform: scale(1.02);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Filters */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--accent);
    color: var(--text-primary);
    border-color: var(--accent);
}

.count-display {
    color: var(--text-muted);
    font-size: 14px;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow);
    border-color: var(--accent);
}

.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-image {
    opacity: 0.8;
}

.gallery-info {
    padding: 1rem;
    text-align: center;
}

.gallery-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.gallery-id {
    font-size: 12px;
    color: var(--text-muted);
}

.poem-preview {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 2rem 1rem 1rem;
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .poem-preview {
    opacity: 1;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}

.load-more-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.load-more-btn:hover {
    background: var(--accent-hover);
}

.load-more-btn:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 2rem;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.overlay-content.image-only {
    max-width: 80vw;
    max-height: 90vh;
    padding: 1rem;
    text-align: center;
}

.overlay-image-container {
    width: 100%;
}

.overlay-image {
    width: 100%;
    height: auto;
    max-width: 70vw;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
    cursor: pointer;
    transition: all 0.3s ease;
}

.poem-content {
    width: 100%;
    cursor: pointer;
}

.overlay.active .overlay-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.poem-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.poem-text {
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-line;
    font-size: 16px;
}

/* Image-only mode styles - CRITICAL for big image display */
.overlay-content.image-only .poem-content {
    display: none !important;
}

.overlay-content.image-only .overlay-image-container {
    background: rgba(16, 16, 16, 0.9);
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.overlay-content.image-only .overlay-image {
    max-height: 70vh !important;
    max-width: 100% !important;
    border-radius: 8px;
}

/* Info Overlay Styles */
.info-overlay {
    z-index: 1001;
}

.info-content {
    max-width: 700px;
    max-height: 85vh;
}

.info-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.info-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section h3 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.5rem 0;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.info-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.info-link:hover {
    background: var(--accent);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.link-icon {
    font-size: 16px;
}

.info-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 14px;
    font-style: italic;
}

/* Pizza Link Styles */
.pizza-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
}

.pizza-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 165, 0, 0.3);
    background: var(--bg-primary);
    border-color: #ff6b35;
}

.pizza-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

.pizza-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.pizza-link:hover .pizza-text {
    color: #ff6b35;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Pizza Info in Modal */
.pizza-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.pizza-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.pizza-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

.pizza-emoji {
    font-size: 18px;
    animation: bounce 2s infinite;
}

.location {
    font-size: 12px;
    opacity: 0.9;
}

/* Print Studio */
.print-info {
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.print-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #4a9eff 0%, #667eea 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.print-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 158, 255, 0.4);
}

.print-emoji {
    font-size: 18px;
    animation: bounce 2s infinite;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

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

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

    .pizza-link {
        order: -1;
        margin-bottom: 1rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls {
        justify-content: center;
    }

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

    .overlay-content {
        margin: 1rem;
        padding: 1.5rem;
    }

    .info-content {
        max-width: 90vw;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .gallery-image {
        height: 200px;
    }
}

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

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

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