:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --fwo-orange: #F5A623;
    --fwo-orange-hover: #E09612;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --card-background: #ffffff;
    --navbar-bg: #ffffff;
    --navbar-text: #6b7280;
    --footer-bg: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

header p {
    color: #64748b;
}

.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

.upload-box {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    background-color: var(--card-background);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.upload-box:hover {
    border-color: var(--primary-color);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-content svg {
    color: var(--primary-color);
}

.browse-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
}

.loading {
    text-align: center;
    margin: 2rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.results {
    margin-top: 3rem;
}

.stats-container {
    margin-bottom: 2rem;
}

.section-title {
    color: var(--text-color);
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

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

.stat-card {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: 600;
}

.thermal-details {
    margin-top: 2rem;
}

.thermal-table-container {
    margin-top: 1rem;
    overflow-x: auto;
    background-color: var(--card-background);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.thermal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.thermal-table th,
.thermal-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.thermal-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #64748b;
}

.thermal-table tr:last-child td {
    border-bottom: none;
}

.thermal-table tbody tr:hover {
    background-color: #f1f5f9;
}

.thermal-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.thermal-item {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.thermal-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.thermal-item p {
    color: var(--text-color);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.map-container {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#map {
    height: 500px;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .thermal-list {
        grid-template-columns: 1fr;
    }
    
    #map {
        height: 300px;
    }
    
    .thermal-table {
        font-size: 0.75rem;
    }
    
    .thermal-table th,
    .thermal-table td {
        padding: 0.5rem;
    }
}

.legend {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}

.legend-line {
    width: 20px;
    height: 3px;
    margin-right: 8px;
    border-radius: 1.5px;
}

.path-legend {
    margin-bottom: 10px;
}

.thermal-entry-marker {
    width: 12px !important;
    height: 12px !important;
    background-color: #f59e0b;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}

.start-marker, .end-marker {
    background: transparent;
    border: none;
}

.height-profile-container {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--card-background);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.height-profile-container h3 {
    color: var(--text-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

#heightProfile {
    width: 100% !important;
    height: 200px !important;
    margin-top: 1rem;
}

.flight-data-rows {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background-color: white;
}

.data-label {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
}

.data-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

@media (max-width: 640px) {
    #heightProfile {
        height: 150px !important;
    }
    
    .flight-data-rows {
        grid-template-columns: 1fr;
    }
}

.paraglider-icon {
    width: 40px !important;
    height: 40px !important;
    margin-left: -20px !important;
    margin-top: -20px !important;
    background: none !important;
    border: none !important;
}

.paraglider-icon svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.4));
    transform: rotate(0deg);
}

.tp-label {
    font-size: 12px;
    white-space: nowrap;
}

.tp-label div {
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.task-details {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.turnpoint-item {
    transition: background-color 0.2s;
}

.turnpoint-item:hover {
    background-color: #f8f9fa;
}

/* Task table styles */
.table-responsive {
    margin: 20px 0;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    border-bottom-width: 2px;
}

.table td, .table th {
    padding: 12px;
    vertical-align: middle;
}

/* Turnpoint type colors */
.table tr td:nth-child(3) {
    font-weight: 500;
}

.table tr[data-type="TAKEOFF"] td:nth-child(3) {
    color: #22c55e;  /* Green */
}

.table tr[data-type="SSS"] td:nth-child(3) {
    color: #3b82f6;  /* Blue */
}

.table tr[data-type="ESS"] td:nth-child(3),
.table tr[data-type="GOAL"] td:nth-child(3) {
    color: #ef4444;  /* Red */
}

.table tr[data-type="TURNPOINT"] td:nth-child(3) {
    color: #f97316;  /* Orange */
}

/* Coordinates column */
.table td:nth-child(4) {
    font-family: monospace;
    font-size: 0.9em;
}

/* Radius column */
.table td:nth-child(5) {
    font-family: monospace;
    font-weight: 500;
}

/* FWO-inspired styling */
.navbar-fwo {
    background-color: var(--navbar-bg) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.75rem 0;
}

.navbar-fwo .navbar-brand {
    color: var(--text-color) !important;
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-fwo .navbar-brand:hover {
    color: var(--fwo-orange) !important;
}

.navbar-fwo .navbar-nav .nav-link {
    color: var(--navbar-text) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-fwo .navbar-nav .nav-link:hover {
    color: var(--fwo-orange) !important;
}

.navbar-fwo .navbar-nav .nav-link.active {
    color: var(--fwo-orange) !important;
}

.albatross-icon {
    height: 60px;
    width: auto;
    color: var(--fwo-orange);
    transition: transform 0.3s ease;
    margin-right: 12px;
}

.navbar-brand:hover .albatross-icon {
    transform: scale(1.1);
}

.btn-fwo-primary {
    background-color: var(--fwo-orange);
    border-color: var(--fwo-orange);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-fwo-primary:hover {
    background-color: var(--fwo-orange-hover);
    border-color: var(--fwo-orange-hover);
    transform: translateY(-1px);
}

.hero-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--navbar-text);
    margin-bottom: 2rem;
}

.footer-fwo {
    background-color: var(--footer-bg);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

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

.footer-fwo h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-fwo a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-fwo a:hover {
    color: var(--fwo-orange);
}

/* Bootstrap Modal Fixes - Ensure proper alignment and z-index handling */
.modal {
    z-index: 1060 !important; /* Higher than navbar (1030) but lower than cookie banner (9999) */
}

.modal-backdrop {
    z-index: 1055 !important; /* Just below modal */
}

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Ensure modal shows above cookie banner if needed */
.modal.show {
    z-index: 10001 !important; /* Above cookie banner when active */
}

.modal.show .modal-backdrop {
    z-index: 10000 !important; /* Just below active modal */
}

/* Center modal vertically */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Responsive modal positioning */
@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
}

/* Fix for modals appearing behind elements */
.modal-open {
    overflow: hidden;
}

.modal-open .modal {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Layer control styling */
.leaflet-control-layers {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 8px !important;
    min-width: 140px;
}

.leaflet-control-layers-expanded {
    padding: 12px !important;
}

.leaflet-control-layers label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text-color) !important;
    margin-bottom: 6px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    padding: 4px 0 !important;
    transition: color 0.2s ease !important;
}

.leaflet-control-layers label:hover {
    color: var(--primary-color) !important;
}

.leaflet-control-layers input[type="radio"] {
    margin-right: 8px !important;
    accent-color: var(--primary-color) !important;
}

.leaflet-control-layers-separator {
    height: 1px !important;
    background: rgba(0, 0, 0, 0.1) !important;
    margin: 8px 0 !important;
    border: none !important;
}

/* Thermal entry marker styles */
.thermal-entry-marker {
    width: 12px !important;
    height: 12px !important;
}

.thermal-marker {
    width: 12px;
    height: 12px;
    background-color: #f59e0b;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
} 