/* Modern Popup Styles */
.popup[hidden] {
    display: none !important;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeInBackdrop 0.3s ease-out;
}

html.flightmap-popup-open,
body.flightmap-popup-open {
    overflow: hidden;
}

.popup-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 32px;
    max-width: 750px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.9);
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: rgba(52, 73, 94, 0.08);
    color: #34495e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.popup-close:hover {
    background: rgba(52, 73, 94, 0.14);
    transform: scale(1.04);
}

.popup-close:focus-visible {
    outline: 3px solid rgba(75, 164, 230, 0.35);
    outline-offset: 2px;
}

.popup-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.popup-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    text-align: center;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.dropzone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  background: #f9f9f9;
}

.file-input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  margin-bottom: 10px;
}

.dropzone-hint {
  color: #888;
  font-size: 0.9em;
}

.popup-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.popup-footnote {
  margin-top: 15px;
  margin-bottom: 15px;
  font-size: 0.85em;
  color: #0066cc;
  background: #e8f4fd;
  border: 1px solid #bee5eb;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,102,204,0.08);
}

/* Modern Dropzone Styles */
.modern-dropzone {
    border: 3px dashed #34495e;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.modern-dropzone:hover {
    border-color: #2980b9;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.modern-dropzone.drag-over {
    border-color: #27ae60;
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.modern-dropzone.is-error {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #ffeaea 0%, #ffcccc 100%);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    font-size: 48px;
    color: #34495e;
    transition: all 0.3s ease;
}

.modern-dropzone:hover .upload-icon {
    color: #2980b9;
    transform: scale(1.1);
}

.modern-dropzone.drag-over .upload-icon {
    color: #27ae60;
    animation: bounce 0.6s ease-in-out;
}

.modern-dropzone.is-error .upload-icon,
.dropzone-error-icon,
.primary-text--error {
    color: #e74c3c;
}

.dropzone-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.primary-text {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.secondary-text {
    font-size: 14px;
    color: #7f8c8d;
}

.file-types {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.file-type-badge {
    background: #34495e;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.hidden-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Selected Files Display */
.selected-files {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.files-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #27ae60;
    font-weight: 600;
    margin-bottom: 10px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    color: #34495e;
    font-size: 16px;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.file-size {
    color: #7f8c8d;
    font-size: 12px;
}

.remove-file {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-file:hover {
    background: #ffe5e5;
    transform: scale(1.1);
}

/* Modern Form Elements */
.modern-input {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.modern-input:focus {
    border-color: #34495e;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.aircraft-type-section {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8fbff 0%, #f1f5f9 100%);
}

.aircraft-type-label {
    display: block;
    font-weight: 600;
    font-size: 0.95em;
    color: #1f2d3d;
    margin-bottom: 8px;
}

.aircraft-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.aircraft-type-option {
    padding: 10px 14px;
    border: 1px solid #e1e8f0;
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-size: 0.9em;
}

.aircraft-type-option .checkmark {
    margin-right: 6px;
}

.aircraft-type-option.is-selected {
    border-color: #4a90e2;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.12) 0%, rgba(74, 144, 226, 0.05) 100%);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.15);
}

.aircraft-type-other {
    margin-bottom: 10px;
}

.aircraft-type-hint {
    font-size: 0.8em;
}

.aircraft-type-hint--error {
    color: #dc3545;
}

.aircraft-type-hint--success {
    color: #198754;
}

.modern-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.modern-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modern-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #34495e;
    border-color: #34495e;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.modern-checkbox input[type="checkbox"]:checked + .checkmark::after {
    display: block;
}

/* Modern Buttons */
.modern-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.modern-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.modern-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary.modern-btn {
    background: #4BA4E6;
    color: white;
}

.modern-btn--ready:not(:disabled),
.btn-primary.modern-btn.modern-btn--ready:not(:disabled) {
    background: #28a745;
    border-color: #28a745;
}

.btn-secondary.modern-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.btn-secondary.modern-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7b7d 100%);
}

/* Animations */
@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0) scale(1.1);
    }
    40% {
        transform: translateY(-10px) scale(1.2);
    }
    80% {
        transform: translateY(-5px) scale(1.15);
    }
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom Scrollbar for Popup Content */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #34495e 0%, #2980b9 100%);
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
}

/* Responsive Design for Popup */
@media (max-width: 768px) {
    .popup-content {
        padding: 24px 20px;
        margin: 16px;
        width: calc(100% - 32px);
        border-radius: 12px;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .popup-subtitle {
        font-size: 15px;
    }
    
    .popup-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .modern-btn {
        width: 100%;
        justify-content: center;
    }
    
    .email-row {
        padding: 16px;
        margin: 16px 0;
    }
    
    .popup-footnote {
        padding: 12px;
        font-size: 12px;
    }
    
    .data-limitations {
        padding: 12px;
        font-size: 12px;
        margin-bottom: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .popup {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .popup-content {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    .email-row {
        border: 2px solid #000000;
        background: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .popup, .popup-content, .modern-btn {
        animation: none;
        transition: none;
    }
}
