/* 기본 폰트 설정 - 이모지 지원 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* 이모지 폰트 설정 */
.flag {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
    font-size: 3rem;
    display: block;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1;
    vertical-align: middle;
    transition: all 0.3s ease;
}

/* 이모지 대체 스타일 - 원형 배경 */
.flag[style*="border-radius: 50%"] {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.flag[style*="border-radius: 50%"]:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

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

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

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

.header-top h1 {
    margin: 0;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.language-switch {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

header h1 {
    margin-bottom: 10px;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-desc {
    font-size: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #7b8eda 60%, #8e7cc3 100%);
    border-radius: 16px;
    padding: 22px 18px 18px 18px;
    margin-bottom: 0;
    font-weight: 400;
    text-align: center;
    box-shadow: 0 4px 24px rgba(102,126,234,0.18);
    letter-spacing: 0.01em;
    line-height: 1.7;
    border: 2px solid rgba(255,255,255,0.18);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .continent-buttons {
        justify-content: center;
    }
    
    .continent-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .pick-button {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .flag {
        font-size: 3rem;
    }
    
    .country-info {
        grid-template-columns: 1fr;
    }
    
    .header-desc {
        font-size: 1rem;
        padding: 14px 8px 12px 8px;
    }
}

.filter-section {
    background: white;
    border-radius: 25px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.filter-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.continent-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.continent-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.continent-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.continent-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.action-section {
    text-align: center;
    margin-bottom: 30px;
}

.pick-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255,107,107,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

.pick-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255,107,107,0.4);
}

.button-icon {
    font-size: 1.5rem;
}

.result-section {
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flag-container {
    margin-bottom: 20px;
}

.result-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.result-card p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.country-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: left;
}

.info-label {
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.history-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.history-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.history-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
}

.history-flag {
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    line-height: 1;
    vertical-align: middle;
}

.history-name {
    font-weight: bold;
    color: #333;
}

.history-continent {
    color: #666;
    font-size: 0.9rem;
}

/* 지도 섹션 스타일 */
.map-section {
    margin: 30px 0;
}

#country-map {
    height: 320px;
    border-radius: 16px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

/* 지도가 로드되지 않을 때 표시할 배경 */
#country-map:empty::before {
    content: '지도를 불러오는 중...';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 14px;
}