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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.header {
    background: white;
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #333;
    font-size: 24px;
    margin: 0;
}

.header h1 a {
    color: #333;
    text-decoration: none;
}

.header h1 a:hover {
    color: #667eea;
}

.global-notification {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px 20px;
    margin: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #155724;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

.join-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.join-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.join-button:active {
    transform: translateY(0);
}

.plus-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
}

.download-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    margin: 0 auto 20px auto;
    text-align: center;
}

.download-section h3 {
    color: #333;
    font-size: 18px;
}

.download-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.download-button:active {
    transform: translateY(0);
}

.download-icon {
    width: 20px;
    height: 20px;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

.leaderboard, .map-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.leaderboard h2, .map-container h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
}

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

.leaderboard-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    color: #6b7280;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    font-size: 14px;
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

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

.leaderboard-table td:first-child {
    color: #6b7280;
    font-weight: 600;
    width: 80px;
}

.leaderboard-table td:nth-child(3) {
    color: #6b7280;
    font-size: 14px;
    width: 100px;
}

.leaderboard-table td:nth-child(4) {
    width: 200px;
}

.pilot-name {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.pilot-name:hover {
    text-decoration: underline;
}

.progress-bar {
    width: 100%;
    max-width: 200px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

#map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #333;
    font-size: 24px;
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.close-button:hover {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="file"] {
    padding: 10px;
}

.submit-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.warning-box {
    margin-bottom: 20px;
    font-size: 10pt;
}

.info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.info-box strong {
    color: #333;
}

.info-box ul {
    margin-left: 20px;
    margin-top: 10px;
}

.info-box li {
    margin-bottom: 5px;
}

.message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pilot-detail {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.pilot-detail h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xcontest-link {
    font-size: 16px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.xcontest-link:hover {
    text-decoration: underline;
}

.ranking-display {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 30px;
}

.stats-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.stats-card h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 10px;
}

.stats-card .big-number {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.stats-card .progress-bar {
    max-width: none;
    height: 12px;
    margin: 10px 0;
}

.stats-card .progress-label {
    color: #6b7280;
    font-size: 14px;
}

.turnpoints-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.turnpoints-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

.turnpoints-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

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

.turnpoints-table a {
    color: #667eea;
    text-decoration: none;
}

.turnpoints-table a:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.turnpoints-list-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    margin: 20px auto;
}

.turnpoints-list-container h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
}

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

.turnpoints-list-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

.turnpoints-list-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

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

.turnpoints-list-table a {
    color: #667eea;
    text-decoration: none;
}

.turnpoints-list-table a:hover {
    text-decoration: underline;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
}
