/**
 * Treasure Survey Styles
 * Styling for the museum treasure identification quiz and improved result display
 */

/* Survey Container */
.survey-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* Page Title */
h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Museum Section */
.museum-section {
    text-align: center;
    margin-bottom: 25px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.museum-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.museum-name {
    margin-top: 10px;
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
}

/* Question Section */
.question {
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.2em;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}

.loading-text {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.error-text {
    text-align: center;
    color: #e74c3c;
    padding: 40px 20px;
}

/* Treasure Options Grid */
.treasure-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.treasure-option {
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
}

.treasure-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.treasure-option:active {
    transform: scale(0.98);
}

.treasure-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #f0f0f0;
}

.treasure-name {
    font-size: 0.9em;
    color: #333;
    margin: 0;
    line-height: 1.3;
    font-weight: 500;
    word-break: break-all;
}

/* Result Section */
.result {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.result-header h2 {
    color: #2c3e50;
    font-size: 1.3em;
    margin: 0 0 8px 0;
}

.result-subtitle {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

/* Improved Chart Styles */
.chart-container {
    margin-bottom: 25px;
}

.horizontal-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bar-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bar-row.correct-answer {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #81c784;
}

.treasure-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.result-treasure-name {
    font-size: 0.95em;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
}

.correct-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: normal;
}

.bar-cell {
    width: 100%;
}

.bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e9ecef;
    border-radius: 20px;
    padding: 4px;
    overflow: hidden;
}

.horizontal-bar {
    height: 24px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: width 0.5s ease;
    min-width: 10px;
}

.horizontal-bar.correct-bar {
    background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
}

.bar-stats {
    font-size: 0.85em;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
    padding-right: 8px;
}

/* Answer Section */
.answer-section {
    margin-bottom: 20px;
}

.answer-card {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #fdd835;
}

.answer-card h3 {
    color: #f57c00;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    text-align: center;
}

.answer-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.answer-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.answer-info {
    flex: 1;
}

.answer-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.answer-museum {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 8px 0;
}

.answer-desc {
    font-size: 0.85em;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* Statistics Section */
.stats-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-number {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    margin-top: 5px;
    opacity: 0.8;
}

.stat-card.highlight .stat-number,
.stat-card.highlight .stat-label {
    color: white;
}

.stats-timestamp {
    text-align: center;
    font-size: 0.8em;
    color: #999;
    margin: 0;
}

/* Show Result Button */
.show-result-btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.show-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.show-result-btn:active {
    transform: scale(0.98);
}

/* More Section */
.more {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.more a {
    color: #667eea;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
}

.more a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .survey-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    .treasure-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .treasure-image {
        height: 100px;
    }
    
    .treasure-name {
        font-size: 0.8em;
    }
    
    .treasure-option {
        padding: 10px;
    }
    
    .result-thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .answer-image {
        width: 80px;
        height: 80px;
    }
    
    .answer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .stats-grid {
        gap: 10px;
    }
    
    .stat-number {
        font-size: 1.5em;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .treasure-option:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border-color: transparent;
    }
    
    .treasure-option:active {
        transform: scale(0.98);
        border-color: #667eea;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    }
    
    .show-result-btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Animation for loading */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-text {
    animation: pulse 1.5s ease-in-out infinite;
}
