:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f8f9fa;
    --accent-color: #28a745;
    --text-color: #333;
    --border-color: #ddd;
    --hover-color: #e9ecef;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.2em;
}

/* Updates Section */
.updates-section {
    margin-top: 20px;
    text-align: center;
}

.updates-button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.updates-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.updates-icon {
    font-size: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.version-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Updates Modal */
.updates-modal {
    z-index: 1001;
}

.updates-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.updates-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.updates-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.current-version, .last-updated {
    margin: 5px 0;
    color: #666;
}

.current-version span, .last-updated span {
    font-weight: bold;
    color: var(--primary-color);
}

.changes-list {
    margin-bottom: 20px;
}

.change-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid #4CAF50;
    transition: transform 0.2s ease;
}

.change-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.change-item.feature {
    border-left-color: #4CAF50;
}

.change-item.improvement {
    border-left-color: #2196F3;
}

.change-item.bugfix {
    border-left-color: #FF9800;
}

.change-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.change-title {
    font-weight: bold;
    color: var(--text-color);
    font-size: 16px;
}

.change-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.change-version {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
}

.change-type {
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 4px;
}

.change-type.feature {
    background: #d4edda;
    color: #155724;
}

.change-type.improvement {
    background: #cce5ff;
    color: #004085;
}

.change-type.bugfix {
    background: #fff3cd;
    color: #856404;
}

.change-description {
    color: #666;
    line-height: 1.5;
    margin-top: 5px;
}

.updates-footer {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-style: italic;
}

.age-selector {
    text-align: center;
    margin-bottom: 30px;
}

.age-selector label {
    font-weight: bold;
    margin-right: 10px;
}

.age-selector select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
}

.museum-list h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.stats {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #666;
}

.museum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.museum-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

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

.museum-card.visited {
    border-color: var(--accent-color);
    background-color: #f8fff9;
}

.museum-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.visit-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    margin-top: 2px;
    cursor: pointer;
}

.museum-info h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.2em;
}

.museum-location {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.museum-description {
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 15px;
}

.museum-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 1000px; /* Further increased for optimal poster display */
    max-height: 90vh; /* Maximized height for better viewing experience */
    overflow-y: auto;
    position: relative;
    margin: 15px;
    padding: 30px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.checklist-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.checklist-content {
    margin-top: 20px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-direction: column;
}

.checklist-item:hover {
    background-color: var(--hover-color);
}

.checklist-item input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    align-self: flex-start;
}

.checklist-item label {
    flex: 1;
    cursor: pointer;
    line-height: 1.4;
    margin-bottom: 8px;
    width: 100%;
}

.checklist-item.completed {
    background-color: #f8fff9;
    border-left: 4px solid var(--accent-color);
}

.checklist-item.completed label {
    text-decoration: line-through;
    color: #666;
}

/* Photo Upload Styles */
.photo-upload-section {
    margin-top: 10px;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    background-color: #fafafa;
    width: 100%;
}

.photo-upload-label {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease;
}

.photo-upload-label:hover {
    background-color: #1e4085;
}

/* Override strikethrough for photo upload buttons in completed items */
.checklist-item.completed .photo-upload-label {
    text-decoration: none;
    color: white !important;
}

.task-photo {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Share Poster Styles */
.share-poster-section {
    text-align: center;
    padding: 20px;
}

.share-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.poster-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
}

.poster-button:hover {
    background-color: #1e4085;
    transform: translateY(-2px);
}

.poster-preview {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    text-align: center; /* Center the canvas */
}

.poster-preview canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto; /* Center the canvas */
    border-radius: 8px; /* Slightly rounded corners for better aesthetics */
}

/* Checklist Customization Styles */
.checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-direction: column;
    position: relative;
}

.checklist-item:hover .checklist-controls {
    opacity: 1;
}

.checklist-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    gap: 4px;
}

.edit-item-btn, .delete-item-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.edit-item-btn:hover {
    background-color: #e3f2fd;
}

.delete-item-btn:hover:not(:disabled) {
    background-color: #ffebee;
}

.delete-item-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.checklist-label {
    flex: 1;
    cursor: pointer;
    line-height: 1.4;
    margin-bottom: 8px;
    width: 100%;
    padding-right: 60px; /* Space for control buttons */
}

.editing-input {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 8px;
    width: calc(100% - 60px);
}

.add-item-section {
    margin-top: 15px;
    text-align: center;
}

.add-item-btn {
    background-color: #f5f5f5;
    border: 2px dashed #ccc;
    color: #666;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.add-item-btn:hover {
    background-color: #e8f5e8;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.custom-item {
    border-left: 4px solid #ff9800;
}

.modified-item {
    border-left: 4px solid #2196f3;
}

/* Achievement Styles */
.achievement-stats {
    margin-top: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.achievement-button {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.achievement-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.achievement-modal .modal-content {
    max-width: 800px;
}

.achievement-summary {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.achievement-overview {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.achievement-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

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

.achievement-poster-button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.achievement-poster-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.achievement-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.achievement-item {
    padding: 20px;
    border-radius: 12px;
    border: 2px solid;
    transition: all 0.3s ease;
    position: relative;
}

.achievement-item.achieved {
    background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.achievement-item.pending {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-color: #dee2e6;
    border-style: dashed;
}

.achievement-emoji {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
    text-align: center;
}

.achievement-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
}

.achievement-description {
    color: #666;
    text-align: center;
    margin-bottom: 10px;
}

.achievement-date {
    font-size: 0.85em;
    color: #888;
    text-align: center;
    font-style: italic;
}

.achievement-progress {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    text-align: center;
    font-size: 0.9em;
}

.achievement-poster-section {
    margin-top: 20px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .museum-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .museum-card {
        padding: 15px;
    }
}