/*
 * 박씨 이미지 팩토리 - Premium Award-Level Design
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Premium Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #f59e0b;
    --accent: #22d3ee;
    --accent-glow: rgba(34, 211, 238, 0.5);

    /* Dark Theme */
    --bg-primary: #030712;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-border: rgba(255, 255, 255, 0.08);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #1e293b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-accent: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);

    /* Effects */
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    /* Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s var(--ease-in-out);
}

a:hover {
    color: var(--primary-light);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Header - Glass Morphism */
header {
    background: linear-gradient(180deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--bg-glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent);
    opacity: 0.8;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Category Navigation */
#category-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s var(--ease-in-out);
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

/* Main Content */
main {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.gallery-item {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
}

.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
    pointer-events: none;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: var(--shadow-card), 0 0 30px rgba(99, 102, 241, 0.2);
}

.gallery-item:hover::before {
    opacity: 0.05;
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s var(--ease-out-expo);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item .caption {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    position: relative;
    z-index: 2;
}

/* Loading & Empty States */
.loading, .empty {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 1rem auto;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Lightbox - Premium */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s var(--ease-out-expo);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
}

.lightbox .close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
}

.lightbox .close:hover {
    color: var(--text-primary);
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
}

#lightbox-caption {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-glass);
    border-radius: 8px;
    border: 1px solid var(--bg-glass-border);
}

/* Footer */
footer {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    border-top: 1px solid var(--bg-glass-border);
    margin-top: 3rem;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.5) 100%);
}

footer a {
    color: var(--primary-light);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    main {
        padding: 1rem;
    }

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

    .gallery-item img {
        height: 120px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}
