/**
 * Airport List - Modern Table View
 * Nav & Pilots - White background with blue accents
 */

/* Hero Section */
.airports-hero {
    background: white;
    color: #333;
    padding: 2rem 0 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    font-family: var(--font-display);
    color: #1e3c72;
}

.hero-subtitle {
    font-size: 1rem;
    margin: 0;
    color: #666;
}

/* Container */
.airports-container {
    padding-top: var(--space-6);
    padding-bottom: var(--space-16);
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    align-items: flex-end;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box i.bi-search {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: var(--text-lg);
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0.75rem 3rem 0.75rem 3rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.clear-search {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.clear-search:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

/* Filters */
.filters {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.filter-group label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.filter-select {
    height: 44px;
    padding: 0 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.btn-reset {
    height: 44px;
    padding: 0 1.25rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-reset:hover {
    background: white;
    border-color: #2a5298;
    color: #2a5298;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: var(--border-width-1) solid var(--border-color-light);
}

#results-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

#results-count strong {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
}

.view-options {
    display: flex;
    gap: var(--space-2);
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    background: #f8f9fa;
    border-color: #2a5298;
    color: #2a5298;
}

.view-btn.active {
    background: #2a5298;
    border-color: #2a5298;
    color: white;
}

/* Table Container */
.table-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.airports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.airports-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.airports-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.airports-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.airports-table th.sortable:hover {
    background: #e9ecef;
    color: #2a5298;
}

.sort-icon {
    font-size: 10px;
    margin-left: 0.25rem;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.airports-table th.sortable:hover .sort-icon {
    opacity: 1;
}

.airports-table th.sorted-asc .sort-icon::before {
    content: "\F62D"; /* bi-chevron-up */
    opacity: 1;
}

.airports-table th.sorted-desc .sort-icon::before {
    content: "\F62E"; /* bi-chevron-down */
    opacity: 1;
}

.airports-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.airports-table tbody tr:hover {
    background: #f8f9fa;
}

.airports-table tbody tr:last-child {
    border-bottom: none;
}

.airports-table td {
    padding: 1rem;
    color: #333;
}

/* Code Badges */
.code-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.code-badge.icao {
    background: #e3f2fd;
    color: #2a5298;
    border: 1px solid #2a5298;
}

.code-badge.iata {
    background: #f5f5f5;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.code-badge.ident {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.code-badge.empty {
    background: #f8f9fa;
    color: #adb5bd;
    border: 1px solid #e0e0e0;
}

/* Type Badge */
.type-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    text-transform: capitalize;
}

.type-badge.public {
    background: #dbeafe;
    color: #1e40af;
}

.type-badge.prive {
    background: #e5e7eb;
    color: #374151;
}

.type-badge.militaire {
    background: #fee2e2;
    color: #991b1b;
}

.type-badge.altiport {
    background: #ede9fe;
    color: #6b21a8;
}

.type-badge.hydro {
    background: #cffafe;
    color: #155e75;
}

.type-badge.ulm {
    background: #d1fae5;
    color: #065f46;
}

.type-badge.planeur {
    background: #fed7aa;
    color: #92400e;
}

.type-badge.heliport {
    background: #fce7f3;
    color: #9f1239;
}

/* Actions */
.actions-cell {
    display: flex;
    gap: var(--space-2);
}

.btn-action {
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: var(--text-base);
}

.btn-action:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}

.btn-view {
    padding: var(--space-2) var(--space-4);
    background: var(--primary-500);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

.btn-view:hover {
    background: var(--primary-600);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Loading */
.loading-row {
    background: transparent !important;
}

.loading-cell {
    text-align: center;
    padding: var(--space-16) var(--space-4) !important;
    color: var(--text-tertiary);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.empty-state h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: var(--text-base);
    margin: 0;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.rows-select {
    padding: var(--space-2) var(--space-3);
    border: var(--border-width-1) solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--bg-primary);
    cursor: pointer;
}

.pagination-controls {
    display: flex;
    gap: var(--space-2);
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-3);
    border: var(--border-width-1) solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--primary-500);
    color: var(--primary-600);
}

.page-btn.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: var(--text-inverse);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1024px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }

    .filters {
        width: 100%;
        justify-content: space-between;
    }

    .table-container {
        overflow-x: auto;
    }

    .airports-table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: var(--text-3xl);
    }

    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .pagination-container {
        flex-direction: column;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
}
