/* Skynet Group Flights Styles */

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navbar Styles */
.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.navbar .btn-outline-primary {
    border-color: #00d4ff;
    color: #00d4ff;
}

.navbar .btn-outline-primary:hover {
    background-color: #00d4ff;
    border-color: #00d4ff;
    color: #1a1a2e;
}

/* Flight Card Styles */
.flight-card {
    background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    border-color: rgba(0, 123, 255, 0.5);
}

.flight-card .card-body {
    color: white;
}

.flight-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
}

.flight-route {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.airport-code {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00d4ff;
    letter-spacing: 1px;
}

.flight-info {
    font-size: 0.9rem;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.85);
}

.info-row i {
    color: #00d4ff;
}

.flight-card .card-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Styles */
.modal-content {
    background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-close {
    filter: invert(1);
}

/* Detail Page Styles */
.flight-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.detail-card {
    background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
}

.detail-header {
    border-bottom: 2px solid rgba(0, 123, 255, 0.5);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.detail-route {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00d4ff;
    margin: 1rem 0;
}

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

.detail-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.detail-item {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
}

.detail-item-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

/* Participants List */
.participants-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.participant-item {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participant-name {
    font-weight: 600;
    font-size: 1rem;
}

.participant-gates {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.creator-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a2e;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

/* Share Button */
.share-url-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-url-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: monospace;
}

.share-url-input:focus {
    outline: none;
    border-color: #00d4ff;
}

.btn-copy {
    background: #00d4ff;
    color: #1a1a2e;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #00b8e6;
    transform: scale(1.05);
}

.btn-copy.copied {
    background: #28a745;
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.action-buttons > div {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
}

.btn-action {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-participate {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: white;
}

.btn-edit {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #1a1a2e;
}

.btn-cancel {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.btn-cancel-flight {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

/* Flight Not Found */
.not-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    color: white;
}

.not-found-icon {
    font-size: 5rem;
    color: #00d4ff;
    margin-bottom: 2rem;
}

.not-found-message {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Map Container for Live Tracking */
.map-container {
    height: 70vh;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(0, 123, 255, 0.3);
    position: relative;
    /* Ensure map container doesn't block interactions */
    pointer-events: auto;
}

.tab-pane {
    min-height: 500px;
}

#overviewMap,
#departureParkingMap,
#arrivalParkingMap {
    height: 100%;
    width: 100%;
    min-height: 500px;
    position: relative;
    z-index: 1;
    /* Ensure maps are interactive */
    pointer-events: auto !important;
}

/* Ensure Leaflet map containers are interactive */
.leaflet-container {
    cursor: grab !important;
    pointer-events: auto !important;
}

.leaflet-container:active {
    cursor: grabbing !important;
}

.leaflet-dragging .leaflet-container {
    cursor: grabbing !important;
}

/* Ensure map panes don't block interaction and render properly */
.leaflet-map-pane {
    pointer-events: auto !important;
    /* DO NOT lock transform - Leaflet needs to change this dynamically for panning */
}

.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-marker-pane {
    pointer-events: auto !important;
}

/* Make sure tab content doesn't interfere */
.tab-pane {
    pointer-events: auto !important;
}

/* Ensure tiles are visible */
.leaflet-tile {
    visibility: visible !important;
    opacity: 1 !important;
}

#skynetMap {
    height: 100%;
    width: 100%;
}

/* Table Styles */
.participants-table {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.participants-table th {
    background: rgba(0, 123, 255, 0.2);
    color: #00d4ff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 123, 255, 0.5);
}

.participants-table td {
    padding: 1rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.participants-table tr:hover {
    background: rgba(0, 123, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
    
    .share-url-container {
        flex-direction: column;
    }
    
    .share-url-input {
        width: 100%;
    }
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

/* Plane Marker Styles */
.plane-marker {
    background: transparent;
    border: none;
}

.plane-marker img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    background: rgba(29, 53, 97, 0.95);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 0.9rem;
}

.leaflet-popup-tip {
    background: rgba(29, 53, 97, 0.95);
}

/* Aircraft Popup Specific Styles */
.aircraft-popup .leaflet-popup-content-wrapper {
    background: #fff;
    padding: 0;
}

.aircraft-popup .leaflet-popup-content {
    margin: 0;
    max-width: 300px;
}

.aircraft-popup .leaflet-popup-tip {
    background: #fff;
}

/* Flatpickr Custom Styles */
.flatpickr-calendar {
    background: #2d3561;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.flatpickr-months {
    background: #1f2544;
}

.flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: white;
}

.flatpickr-weekdays {
    background: #1f2544;
}

.flatpickr-weekday {
    color: #00d4ff;
}

.flatpickr-day {
    color: white;
}

.flatpickr-day:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #00d4ff;
    color: #1a1a2e;
    border-color: #00d4ff;
}

.flatpickr-day.today {
    border-color: #00d4ff;
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.flatpickr-time {
    background: #1f2544;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.flatpickr-time input {
    color: white;
}

.flatpickr-time .numInput:hover,
.flatpickr-time .numInput:focus {
    background: rgba(0, 212, 255, 0.1);
}

.flatpickr-am-pm {
    color: white;
}

.flatpickr-am-pm:hover,
.flatpickr-am-pm:focus {
    background: rgba(0, 212, 255, 0.2);
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: white;
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
    fill: #00d4ff;
}

.numInputWrapper:hover {
    background: rgba(0, 212, 255, 0.1);
}

.flatpickr-input {
    cursor: pointer;
}

.flatpickr-input:focus {
    border-color: #00d4ff;
}

/* Parking/Gate Map Styles */
.parking-map-container {
    background: #000;
}

.gate-marker {
    text-align: center;
    cursor: pointer;
    display: inline-block;
}

.gate-label.reserved {
    background-color: #ff6b6b !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 0.9;
}

.gate-label.reserved .gate-airlines {
    color: #fff !important;
}

.gate-label {
    background: #000;
    color: #fff;
    padding: 6px 10px 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: inline-block;
    max-width: 120px;
    transition: all 0.2s ease;
}

.gate-label:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.gate-label.active {
    background: #00e676;
    color: #000;
    border-color: #00e676;
}

.gate-label.other-airline {
    background: #404040;
}

.gate-name-line {
    white-space: nowrap;
}

.gate-airlines {
    font-size: 9px;
    font-weight: normal;
    margin-top: 2px;
    opacity: 0.85;
    line-height: 1.3;
    word-wrap: break-word;
    white-space: normal;
}

/* Hub Badges */
.hub-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hub-badge {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
}

.hub-badge:hover {
    background: linear-gradient(135deg, #00b8e6 0%, #007a99 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
}

.hub-badge:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 212, 255, 0.2);
}

.hub-badge i {
    font-size: 0.9rem;
}

/* Map Tabs Styles */
.nav-tabs {
    border-bottom: 2px solid rgba(0, 123, 255, 0.3);
}

.nav-tabs .nav-link {
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    margin-right: 0.25rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #00d4ff;
    border-color: rgba(0, 123, 255, 0.3);
}

.nav-tabs .nav-link.active {
    background: rgba(0, 123, 255, 0.2);
    color: #00d4ff;
    border-color: rgba(0, 123, 255, 0.5);
    font-weight: 600;
}

.tab-content {
    padding-top: 1rem;
}

/* Table Styles for Flights List */
/* Flight Filter Toggle */
.flight-filter-label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0;
}

.btn-group .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-group .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.btn-group .btn-outline-secondary:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.btn-group .btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-color: #00d4ff;
    color: white;
}

.btn-group .btn-primary:hover {
    background: linear-gradient(135deg, #00e5ff 0%, #00aad4 100%);
    border-color: #00e5ff;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

/* Flights Table */
.table-dark {
    background: linear-gradient(135deg, #2d3561 0%, #1f2544 100%);
    border-radius: 12px;
    overflow: hidden;
}

.table-dark thead th {
    background: rgba(0, 123, 255, 0.2);
    color: #00d4ff;
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 123, 255, 0.5);
    padding: 1rem;
    user-select: none;
}

.table-dark thead th i {
    font-size: 0.8rem;
    margin-left: 0.5rem;
    opacity: 0.7;
}

.table-dark tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.table-dark tbody tr:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.01);
}

.table-dark tbody tr.flight-row:hover {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.table-dark td {
    padding: 1rem;
    color: white;
    vertical-align: middle;
}

.table-dark .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
}

.table-responsive {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Message Board Styles */
.message-board-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.message-board-container::-webkit-scrollbar {
    width: 8px;
}

.message-board-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.message-board-container::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 4px;
}

.message-board-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.7);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.message-author {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.message-author strong {
    color: #fff;
    font-size: 0.95rem;
}

.message-timestamp {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    white-space: nowrap;
}

.message-content {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-action-buttons {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-item:hover .message-action-buttons {
    opacity: 1;
}

.message-action-buttons .btn {
    font-size: 0.85rem;
    min-width: auto;
    padding: 0.25rem 0.5rem;
}

.message-action-buttons .btn:hover {
    transform: scale(1.1);
    transition: transform 0.1s ease;
}

.message-item.editing {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.message-edit-form textarea {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    resize: vertical;
}

.message-edit-form textarea:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 212, 255, 0.5);
    color: #fff;
}

.message-edit-form .gap-2 {
    gap: 0.5rem;
}

.message-input-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
}

.message-input-container textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    resize: none;
}

.message-input-container textarea:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: #00d4ff;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(0, 212, 255, 0.15);
}

.message-input-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.message-input-container .btn-primary {
    background: linear-gradient(135deg, #0066ff, #00d4ff);
    border: none;
    font-weight: 600;
}

.message-input-container .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0052cc, #00b3cc);
    transform: translateY(-1px);
}

.message-input-container .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Flight Description Box */
.flight-description-box {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.15), rgba(0, 212, 255, 0.15));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.flight-description-label {
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flight-description-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
}
