/* 国家与地区查询 - 工具专用样式 */

/* ============================================
   搜索和筛选区域
   ============================================ */
.search-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.search-container {
    display: flex;
    flex: 1;
    min-width: 250px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.search-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.filter-container {
    min-width: 200px;
}

.continent-filter {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    cursor: pointer;
    background-color: white;
    transition: border-color 0.3s;
}

.continent-filter:focus {
    outline: none;
    border-color: #4CAF50;
}

/* ============================================
   国家列表
   ============================================ */
.countries-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.country-card {
    display: flex;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #4CAF50;
}

.country-flag {
    width: 100px;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
}

.country-flag img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.country-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.country-name {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.country-english-name {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #7f8c8d;
}

.country-basic-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: #555;
}

.country-capital,
.country-population {
    display: flex;
    align-items: center;
    gap: 5px;
}

.country-capital i,
.country-population i {
    color: #4CAF50;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    color: #7f8c8d;
    font-size: 16px;
}

/* ============================================
   国家详情模态框
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 40px;
    border-radius: 16px;
    width: 85%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #333;
    transform: rotate(90deg);
}

/* ============================================
   国家详情样式
   ============================================ */
.country-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.country-flag-large {
    width: 120px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 10px;
    border-radius: 8px;
}

.country-flag-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.country-title h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: #2c3e50;
    font-weight: 600;
}

.country-title p {
    margin: 0;
    font-size: 16px;
    color: #7f8c8d;
}

.country-map {
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.country-map img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 8px;
}

.country-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: #555;
    font-size: 15px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.country-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.detail-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.detail-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-list li {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    line-height: 1.6;
}

.detail-label {
    font-weight: 600;
    color: #555;
    width: 120px;
    margin-right: 10px;
}

.detail-value {
    color: #2c3e50;
    flex: 1;
}

.landmarks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.landmarks-list li {
    margin-bottom: 8px;
    color: #2c3e50;
    padding-left: 20px;
    position: relative;
}

.landmarks-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
    font-size: 20px;
}

/* ============================================
   响应式调整
   ============================================ */
@media (max-width: 768px) {
    .search-filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container,
    .filter-container {
        width: 100%;
        min-width: unset;
    }

    .countries-container {
        grid-template-columns: 1fr;
    }

    .country-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .country-flag-large {
        width: 100px;
        height: 70px;
    }

    .modal-content {
        width: 95%;
        padding: 25px;
        margin: 20px auto;
        max-height: 90vh;
    }

    .country-title h2 {
        font-size: 24px;
    }

    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }

    .country-details {
        grid-template-columns: 1fr;
    }

    .close-modal {
        top: 15px;
        right: 15px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .search-input,
    .search-btn,
    .continent-filter {
        font-size: 14px;
    }

    .search-btn {
        padding: 12px 18px;
    }

    .country-name {
        font-size: 16px;
    }

    .country-flag {
        width: 80px;
        min-width: 80px;
        padding: 10px;
    }

    .country-info {
        padding: 12px;
    }

    .modal-content {
        padding: 20px;
    }
}
