/**
 * National Treasures Survey Styles
 * Mobile-first responsive design
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", 
                 "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.survey-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header Styles */
h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* Loading and Error States */
.loading-text, .error-text {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-size: 1.1em;
}

.error-text {
    color: #e74c3c;
}

/* Treasures Grid */
.treasures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.treasure-card {
    position: relative;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.treasure-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.treasure-card.selected {
    border-color: #2ecc71;
    background: #e8f8f5;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.treasure-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
}

.treasure-label {
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
}

.treasure-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
}

.treasure-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.treasure-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
}

.treasure-museum {
    font-size: 0.9em;
    color: #3498db;
    font-weight: 500;
}

.treasure-description {
    font-size: 0.85em;
    color: #7f8c8d;
    line-height: 1.4;
}

/* Submit Button */
.submit-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Result Button */
.show-result-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.show-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

/* Result Section */
.result {
    margin-top: 20px;
}

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

.result-header h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.result-subtitle {
    color: #7f8c8d;
    font-size: 1em;
}

/* Distribution Section */
.distribution-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.distribution-section h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bar-label {
    min-width: 50px;
    font-weight: 600;
    color: #34495e;
    text-align: right;
}

.bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

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

.bar-stats {
    font-size: 0.9em;
    color: #7f8c8d;
    white-space: nowrap;
}

/* Ranking Section */
.ranking-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.ranking-section h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 5px;
}

.ranking-subtitle {
    color: #95a5a6;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid #ecf0f1;
    transition: all 0.3s ease;
}

.rank-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.rank-card.rank-1 {
    border-color: #f1c40f;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.rank-card.rank-2 {
    border-color: #95a5a6;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
}

.rank-card.rank-3 {
    border-color: #e67e22;
    background: linear-gradient(135deg, #fff4e6 0%, #ffffff 100%);
}

.rank-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: white;
    font-weight: 700;
    font-size: 1.2em;
    border-radius: 50%;
}

.rank-1 .rank-number {
    background: #f1c40f;
    color: #2c3e50;
}

.rank-2 .rank-number {
    background: #95a5a6;
}

.rank-3 .rank-number {
    background: #e67e22;
}

.rank-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #ecf0f1;
}

.rank-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rank-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #2c3e50;
}

.rank-museum {
    font-size: 0.85em;
    color: #7f8c8d;
}

.rank-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.rank-count {
    font-weight: 600;
    font-size: 1.1em;
    color: #2c3e50;
}

.rank-percentage {
    font-size: 0.85em;
    color: #95a5a6;
}

/* Summary Section */
.summary-section {
    text-align: center;
    padding: 20px;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 20px 30px;
    background: #ecf0f1;
    border-radius: 10px;
}

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

.summary-number {
    font-size: 2em;
    font-weight: 700;
}

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

.summary-timestamp {
    color: #95a5a6;
    font-size: 0.85em;
}

/* More Link */
.more {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.more a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.more a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .survey-container {
        padding: 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .treasures-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .treasure-image {
        height: 180px;
    }
    
    .submit-btn,
    .show-result-btn {
        font-size: 1.1em;
        padding: 12px 25px;
    }
    
    .result-header h2 {
        font-size: 1.5em;
    }
    
    .distribution-section,
    .ranking-section {
        padding: 20px;
    }
    
    .bar-label {
        min-width: 40px;
        font-size: 0.9em;
    }
    
    .rank-card {
        padding: 12px;
    }
    
    .rank-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .summary-stats {
        gap: 15px;
    }
    
    .summary-card {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .survey-container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    .treasure-name {
        font-size: 1.1em;
    }
    
    .treasure-museum,
    .treasure-description {
        font-size: 0.8em;
    }
    
    .rank-number {
        min-width: 35px;
        height: 35px;
        font-size: 1em;
    }
    
    .rank-thumbnail {
        width: 45px;
        height: 45px;
    }
    
    .rank-name {
        font-size: 1em;
    }
    
    .summary-number {
        font-size: 1.5em;
    }
}
