/* Mobile-Friendly Minimal Design for Songdo Archive */

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Minimal Header */
.minimal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: transparent;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: background 0.2s;
}

.back-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.header-title .subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

/* Category Navigation */
.category-nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    height: 48px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 999;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav-items {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    height: 100%;
    align-items: center;
}

.category-chip {
    padding: 6px 14px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-chip:active {
    background: #e8e8e8;
}

.category-chip.active {
    background: #1a1a1a;
    color: white;
}

.category-chip .icon {
    font-size: 14px;
}

.category-chip .count {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 2px;
}

.category-chip.active .count {
    background: rgba(255,255,255,0.3);
}

/* Mobile Container */
.mobile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    padding-top: 120px;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Mobile Header */
.mobile-header {
    margin-bottom: 1.5rem;
}

.mobile-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.mobile-header .meta {
    font-size: 0.9rem;
    color: #666;
}

/* Mobile Gallery Grid */
.mobile-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
    cursor: pointer;
}

.gallery-item:active {
    transform: scale(0.98);
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.gallery-item-info {
    padding: 12px;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal Improvements */
.modal {
    background-color: rgba(0,0,0,0.95);
}

.modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1002;
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95%;
    max-height: 90vh;
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-description {
    color: white;
    background-color: rgba(0,0,0,0.6);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    max-width: 90vw;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border-radius: 8px;
}

.modal-nav:hover {
    background-color: rgba(255,255,255,0.3);
}

.modal-nav.prev {
    left: 1rem;
}

.modal-nav.next {
    right: 1rem;
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Tablet & Desktop Responsive */
@media (min-width: 768px) {
    .mobile-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

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

    .header-title h1 {
        font-size: 1.5rem;
    }

    .category-chip {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .mobile-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

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

/* Hide scrollbar but keep functionality */
.category-nav::-webkit-scrollbar {
    height: 0;
}

.category-nav {
    scrollbar-width: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    color: #666;
    transition: background 0.2s;
}

.header-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.header-btn.active {
    background: #1a1a1a;
    color: white;
}
