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

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

/* Layout */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: #007cba;
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.app-header h1 {
    font-size: 1.5rem;
    margin: 0;
    text-align: center;
    flex: 1;
}

.last-updated {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: center;
    margin-top: 1.5rem;
    padding-bottom: 1rem;
}

.archive-toggle {
    all: unset;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

/* Only enable hover on devices with fine pointer (mouse/touchpad) */
@media (hover: hover) and (pointer: fine) {
    .archive-toggle:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .exhibition-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    }

    .archive-btn:hover {
        filter: grayscale(0);
        opacity: 1;
        background: rgba(0, 0, 0, 0.05);
        border-radius: 50%;
    }

    .detail-urls a:hover {
        background: #005a87;
    }
}

.archive-toggle svg {
    width: 20px;
    height: 20px;
}



/* Main Content */
.app-content {
    flex: 1;
    padding: 1rem;
}

.view {
    display: block;
}

.view.hidden {
    display: none;
}

/* Exhibition Grid */
.exhibition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Exhibition Card */
.exhibition-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd),
                linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.card-footer .archive-btn {
    margin: 0;
    margin-left: auto;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: #333;
}

.card-location {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.card-location::before {
    content: "📍";
    margin-right: 0.25rem;
}

.card-dates {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.remaining-time {
    font-weight: 600;
    color: #007cba;
}

.end-date {
    color: #666;
    font-size: 0.8rem;
    margin-left: 4px;
}

/* Special formatting for upcoming exhibitions */
.upcoming-current-month {
    color: #007cba;
    font-weight: 600;
}

.upcoming-other-month {
    color: #28a745;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.current {
    background: #d4edda;
    color: #155724;
}

.status-badge.upcoming {
    background: #fff3cd;
    color: #856404;
}

.status-badge.past {
    background: #f8d7da;
    color: #721c24;
}

.archive-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(1);
    opacity: 0.6;
}

.archive-btn:active {
    transform: scale(0.95);
}

.archive-btn.unarchive {
    filter: grayscale(0);
    opacity: 1;
    color: #28a745;
}

.archive-btn svg {
    width: 22px;
    height: 22px;
}

.archived-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #17a2b8;
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Back Button Styles */
.back-button-header {
    all: unset;
    color: white;
    padding: 0;
    cursor: pointer;
    font-size: 1.4rem;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.back-button-header svg {
    width: 1em;
    height: 1em;
    display: block;
}

.exhibition-detail {
    max-width: 800px;
    margin: 0 auto;
}

.detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
    background: #f0f0f0;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.meta-value {
    font-weight: 600;
    color: #333;
}

.detail-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: #444;
}

.detail-urls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-urls a {
    background: #007cba;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
}

/* Loading and Notifications */
.loading, .notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    z-index: 1000;
    text-align: center;
}

.notification {
    top: 20px;
    transform: translateX(-50%);
    background: #28a745;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -100%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .exhibition-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .app-content {
        padding: 0.75rem;
    }
    
    .detail-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.75rem 0.5rem;
    }
    
    .app-header h1 {
        font-size: 1.25rem;
    }
    
.card-content {
    position: relative;
    padding: 1rem;
}
    
    .detail-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* PWA Install Prompt */
.pwa-install {
    background: #28a745;
    color: white;
    padding: 1rem;
    text-align: center;
    position: sticky;
    bottom: 0;
    z-index: 90;
}

.pwa-install button {
    background: white;
    color: #28a745;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 1rem;
}