/**
 * Museum Popularity Survey Styles
 * Styling for the museum popularity voting interface
 */

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

/* Survey Container */
.survey-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Page Title */
h1 {
    text-align: center;
    color: #4a5568;
    font-size: 1.6em;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

/* Survey Intro */
.survey-intro {
    text-align: center;
    color: #718096;
    font-size: 1em;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Loading Text */
.loading-text {
    text-align: center;
    color: #a0aec0;
    padding: 40px 20px;
}

/* Error Text */
.error-text {
    text-align: center;
    color: #e53e3e;
    padding: 20px;
    background: #fff5f5;
    border-radius: 8px;
}

/* Museum Options Container */
.museum-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Museum Option Card */
.museum-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.museum-option:hover {
    border-color: #667eea;
    background: #eef2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.museum-option:active {
    transform: scale(0.98);
    background: #e0e7ff;
}

/* Touch device hover behavior */
@media (hover: none) {
    .museum-option:hover {
        transform: none;
        box-shadow: none;
    }
    
    .museum-option:active {
        border-color: #667eea;
        background: #e0e7ff;
    }
}

/* Museum Image */
.museum-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}

/* Museum Info */
.museum-info {
    flex: 1;
    min-width: 0;
}

.museum-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.museum-location {
    font-size: 0.9em;
    color: #718096;
    margin: 0;
}

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

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

.result-header h2 {
    color: #4a5568;
    font-size: 1.4em;
    margin: 0 0 8px 0;
}

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

/* Ranking Container */
.ranking-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Rank Item */
.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f7fafc;
    border-radius: 12px;
    transition: background 0.2s;
}

.rank-item.top-rank {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
}

/* Rank Badge */
.rank-badge {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #4a5568;
    background: white;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-rank .rank-badge {
    font-size: 1.4em;
    background: transparent;
    box-shadow: none;
}

/* Rank Info */
.rank-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rank-museum-name {
    font-size: 1em;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-museum-location {
    font-size: 0.8em;
    color: #718096;
}

/* Rank Bar Cell */
.rank-bar-cell {
    width: 100px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rank-bar-wrapper {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

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

.rank-stats {
    font-size: 0.75em;
    color: #718096;
    text-align: right;
}

/* Stats Section */
.stats-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

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

.stat-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #718096;
    margin-top: 4px;
}

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

.stats-note {
    text-align: center;
    font-size: 0.85em;
    color: #667eea;
    margin: 0;
    padding: 12px;
    background: #eef2ff;
    border-radius: 8px;
}

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

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

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

/* More Section */
.more {
    margin-top: 24px;
    text-align: center;
}

.more a {
    display: inline-block;
    padding: 12px 24px;
    color: #667eea;
    text-decoration: none;
    font-size: 1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    transition: all 0.2s;
}

.more a:hover {
    background: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .survey-container {
        padding: 20px 16px;
        border-radius: 16px;
    }
    
    h1 {
        font-size: 1.4em;
    }
    
    .museum-option {
        padding: 14px;
        gap: 12px;
    }
    
    .museum-image {
        width: 50px;
        height: 50px;
    }
    
    .museum-name {
        font-size: 1em;
    }
    
    .rank-item {
        padding: 12px;
        gap: 10px;
    }
    
    .rank-badge {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }
    
    .rank-museum-name {
        font-size: 0.95em;
    }
    
    .rank-bar-cell {
        width: 80px;
    }
    
    .stat-number {
        font-size: 1.5em;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .survey-container {
        padding: 16px 12px;
    }
    
    h1 {
        font-size: 1.2em;
    }
    
    .museum-option {
        padding: 12px;
    }
    
    .museum-image {
        width: 44px;
        height: 44px;
    }
    
    .rank-bar-cell {
        width: 70px;
    }
}
