/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

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

/* Category Tabs */
.category-section {
    margin: 2rem 0 1rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: #3b82f6;
}

.tab-btn.active {
    color: #1e3a8a;
    border-bottom-color: #3b82f6;
}

/* Controls Section */
.controls-section {
    margin: 2rem 0;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4b5563;
}

.control-group input,
.control-group select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.control-group input {
    position: relative;
}

.btn-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Results Count */
.results-section {
    margin: 1rem 0;
}

.results-count {
    font-size: 0.95rem;
    color: #6b7280;
}

/* Aircraft Grid */
.aircraft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.aircraft-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.aircraft-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.aircraft-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aircraft-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.aircraft-card:hover .aircraft-card-image img {
    transform: scale(1.05);
}

.aircraft-card-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 1.5rem;
}

.aircraft-card-header h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.aircraft-card-header .manufacturer {
    font-size: 0.95rem;
    opacity: 0.9;
}

.aircraft-card-body {
    padding: 1.5rem;
}

.aircraft-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9rem;
}

.info-value {
    color: #111827;
    font-size: 0.9rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-retired {
    background: #fee2e2;
    color: #991b1b;
}

.aircraft-card-footer {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.compare-checkbox input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.view-details-btn {
    background: #f3f4f6;
    color: #1e3a8a;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.view-details-btn:hover {
    background: #e5e7eb;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    margin: 2rem 0;
}

.no-results p {
    font-size: 1.2rem;
    color: #6b7280;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.comparison-modal-content {
    max-width: 1200px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #1e3a8a;
    font-size: 1.8rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.detail-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h3 {
    color: #1e3a8a;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3b82f6;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

.detail-item-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.detail-item-value {
    color: #111827;
    font-size: 1rem;
}

.features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.features-list li {
    padding: 0.75rem;
    background: #f9fafb;
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
}

.operators-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.operator-badge {
    background: #dbeafe;
    color: #1e3a8a;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Comparison Table */
.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #1e3a8a;
    position: sticky;
    top: 0;
}

.comparison-table td {
    color: #111827;
}

.comparison-table tr:hover {
    background: #f9fafb;
}

/* Footer */
footer {
    background: #1e3a8a;
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    margin: 0.25rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .tabs {
        flex-direction: column;
        gap: 0;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        text-align: left;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .aircraft-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .comparison-table {
        font-size: 0.9rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header .tagline {
        font-size: 1rem;
    }
}
