/* ================================================
   机场查询工具专用样式
   ================================================ */

/* 搜索区域 */
.search-section {
    margin-bottom: 2rem;
}

.search-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.search-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
}

.search-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.search-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* 搜索表单 */
.search-form {
    padding: 2rem;
}

/* 表单行布局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.form-label i {
    color: var(--primary-green);
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(74, 156, 1, 0.1);
    background: var(--bg-primary);
}

/* 修复浏览器自动填充样式 */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-primary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    border-color: var(--primary-green) !important;
}

/* 修复Firefox自动填充样式 */
.form-input:-moz-autofill {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.form-input.error {
    border-color: var(--error-color, #dc3545);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-input.error:focus {
    border-color: var(--error-color, #dc3545);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 搜索操作按钮区域 */
.search-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* PC端按钮布局：重置在左，查询在右 */
@media (min-width: 769px) {
    .search-actions {
        justify-content: center;
        flex-direction: row;
    }
    
    .search-btn.secondary {
        order: 1;
    }
    
    .search-btn.primary {
        order: 2;
    }
}

.search-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
}

.search-btn.primary {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.search-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn.primary:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.search-btn.secondary {
    background: linear-gradient(135deg, rgba(74, 156, 1, 0.08), rgba(74, 156, 1, 0.05));
    color: var(--primary-green-dark);
    border: 1px solid rgba(74, 156, 1, 0.2);
    box-shadow: 0 2px 8px rgba(74, 156, 1, 0.1);
}

.search-btn.secondary:hover {
    background: linear-gradient(135deg, rgba(74, 156, 1, 0.15), rgba(74, 156, 1, 0.1));
    color: var(--primary-green);
    border-color: rgba(74, 156, 1, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 156, 1, 0.15);
}

/* 按钮波纹效果 */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    width: 0;
    height: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-btn:active .btn-ripple {
    width: 300px;
    height: 300px;
}

/* 演示单号样式 */
.demo-bill-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.demo-bill-number {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-green);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
}

.demo-bill-number:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 机场查询说明 */
.airport-description {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(74, 156, 1, 0.03) 0%, rgba(74, 156, 1, 0.01) 100%);
    border-bottom: 1px solid var(--border-light);
    border-radius: 20px;
    margin-top: 40px;
}

.airport-description p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    text-align: justify;
}

.airport-description p:first-child {
    margin-top: 0;
}

.airport-description p:last-child {
    margin-bottom: 0;
}

.airport-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 结果区域 */
.results-section {
    animation: fadeInUp 0.5s ease-out;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-title::before {
    content: '\f0ca';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-green);
    font-size: 1.25rem;
}

.results-stats {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* 机场表格样式 - 简约清晰 */
.airport-table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.airport-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--bg-primary);
}

.airport-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-medium);
    position: sticky;
    top: 0;
    z-index: 5;
    font-size: 0.875rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    vertical-align: middle;
}

.airport-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    line-height: 1.4;
}

.airport-table tbody tr {
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease forwards;
}

.airport-table tbody tr:hover {
    background: var(--primary-green-alpha);
}

.airport-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

.airport-table tbody tr:nth-child(even):hover {
    background: var(--primary-green-alpha);
}

/* 表格列宽设置 */
.col-code {
    width: 120px;
    min-width: 120px;
}

.col-name-en {
    min-width: 300px;
    width: auto;
}

.col-name-zh {
    width: 260px;
    min-width: 260px;
}

.col-country {
    width: 200px;
    min-width: 200px;
}

.col-latitude {
    width: 140px;
    min-width: 140px;
}

.col-longitude {
    width: 140px;
    min-width: 140px;
}

/* 机场代码样式 */
.airport-code {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 1px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    box-shadow: var(--shadow-sm);
    vertical-align: middle;
}

/* 机场名称样式 */
.airport-name-en {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.airport-name-zh {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.2;
}

/* 国家信息样式 */
.country-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    height: 100%;
}

.country-code {
    color: white;
    font-size: 0.7rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    background: var(--primary-green);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    line-height: 1;
}

.country-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 坐标值样式 */
.coordinate-value {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 500;
    border: 1px solid var(--border-light);
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
}

/* 空状态样式调整 */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

.empty-state .empty-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state .empty-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state .empty-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.empty-state .empty-action {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.empty-state .empty-action:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background: var(--primary-green-alpha);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.pagination-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
}

/* 响应式设计 */
/* 移动端布局 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* 移动端按钮布局：查询在上，重置在下 */
    .search-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .search-btn.primary {
        order: 1;
    }
    
    .search-btn.secondary {
        order: 2;
    }
    
    .search-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .airport-table-container {
        overflow-x: auto;
    }
    
    .airport-table {
        min-width: 700px;
    }
    
    .airport-table th,
    .airport-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .airport-code {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .coordinate-value {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
        min-height: 1.8rem;
    }
    
    .country-code {
        padding: 0.1rem 0.3rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .search-form {
        padding: 1.5rem;
    }
    
    .airport-description {
        padding: 1rem;
    }
    
    .form-input {
        padding: 0.875rem 1rem;
    }
    
    .search-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .airport-table th,
    .airport-table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .airport-code {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .coordinate-value {
        padding: 0.2rem 0.3rem;
        font-size: 0.7rem;
        min-height: 1.5rem;
    }
    
    .country-code {
        padding: 0.08rem 0.25rem;
        font-size: 0.6rem;
    }
    
    .airport-name-en {
        font-size: 0.8rem;
        margin-bottom: 0.1rem;
    }
    
    .airport-name-zh {
        font-size: 0.75rem;
    }
    
    .country-name {
        font-size: 0.75rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.airport-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.airport-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.airport-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.airport-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.airport-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.airport-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.airport-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.airport-table tbody tr:nth-child(8) { animation-delay: 0.4s; }

.search-card {
    animation: fadeInUp 0.5s ease forwards;
}

.results-section {
    animation: fadeInUp 0.4s ease forwards;
}

/* 高亮输入框动画 */
.highlight-input {
    animation: highlightPulse 1s ease-in-out;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px rgba(74, 156, 1, 0.1) !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 156, 1, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 156, 1, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 156, 1, 0);
    }
}

/* 查询加载动画特定调整 */
.query-loading-text {
    margin-bottom: 0.5rem;
}

.query-loading-subtext {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 暗色主题适配 */
[data-theme="dark"] .airport-table tbody tr:nth-child(even) {
    background: rgba(55, 65, 81, 0.3);
}

[data-theme="dark"] .country-code {
    background: var(--bg-secondary);
}

[data-theme="dark"] .coordinates {
    background: var(--bg-secondary);
    border-left-color: var(--primary-green-light);
}
