/* Modern Dark Theme - Pilot Profile Page */

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #222222;
    --bg-tertiary: #2a2a2a;
    --text-primary: #f0f0f0;
    --text-secondary: #c0c0c0;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --si-yellow: #FDB813;
    --accent-primary: #FDB813;
    --accent-secondary: rgba(253, 184, 19, 0.1);
    --success-green: #10b981;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --transition-fast: all 0.2s ease;
}

body {
    background: #0a0a0a;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding-top: 0 !important;
}

/* Profile Header Section */
.profile-header-section {
    background: transparent;
    padding: 1rem 0;
    position: relative;
    overflow: hidden;
    min-height: auto;
}

.profile-header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(253, 184, 19, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(253, 184, 19, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* Pilot Badge Container Adjustments */
#pilotBadgeContainer {
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 10px;
}

/* Mini Stat Cards */
.stat-card-mini {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    transition: all var(--transition-fast);
    height: 100%;
}

.stat-card-mini:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--si-yellow);
}

.stat-icon-mini {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--si-yellow);
    opacity: 0.8;
}

.stat-value-mini {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1;
}

.stat-label-mini {
    font-size: 0.7rem;
    font-weight: 500;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

/* Rank Icon Wrapper */
.rank-icon-wrapper {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--si-yellow) 0%, rgba(253, 184, 19, 0.6) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.rank-icon-wrapper i {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Header Call-to-Action Buttons */
.cta-primary {
    background: linear-gradient(135deg, #FDB813 0%, #ffa500 100%);
    color: #1a1a1a;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #FDB813;
    border: 2px solid rgba(253, 184, 19, 0.5);
    transition: all 0.3s ease;
}

/* Achievement Badge Styling - Using BadgeDisplay Component */
#achievements {
    padding-top: 1rem;
}

/* Recent Flights Styling */
.flight-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all var(--transition-fast);
}

.flight-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(253, 184, 19, 0.3);
}

.flight-item:last-child {
    margin-bottom: 0;
}

.flight-route {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flight-route i {
    color: var(--si-yellow);
    opacity: 0.8;
}

.flight-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.flight-detail-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #c0c0c0;
}

.flight-detail-item i {
    color: #a0a0a0;
}

.flight-detail-item .badge {
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #f0f0f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Progress Bars */
.progress {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: var(--si-yellow);
    transition: width 1s ease-in-out;
}

.progress-bar.bg-primary {
    background: var(--si-yellow) !important;
}

.progress-bar.bg-success {
    background: var(--success-green) !important;
}

/* Card Overrides for Profile Page */
.card {
    overflow: hidden;
}

.card-header {
    border-radius: 0 !important;
}

.card-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #FDB813;
}

.card-body {
    color: #e0e0e0;
}

/* Rank Display Colors */
#rankDisplay {
    font-weight: 700;
    padding: 0.5rem 1rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#currentRank {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading Overlay Positioning */
#loadingSpinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    z-index: 9999;
}

#loadingSpinner.d-none {
    display: none !important;
}

/* Error Message Styling */
#errorMessage {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .profile-header-section {
        padding: 0.75rem 0;
    }
    
    .profile-header-section .container-fluid,
    .container-fluid[style*="padding-left"] {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    #pilotBadgeContainer {
        margin-bottom: 2rem;
        position: static;
    }
    
    .stat-card-mini {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    .profile-header-section {
        text-align: center;
    }
    
    .stat-value-mini {
        font-size: 1.25rem;
    }
    
    .stat-label-mini {
        font-size: 0.65rem;
    }
    
    .flight-details {
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .flight-route {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .flight-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse-red {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-card-mini,
.badge-item,
.flight-item {
    animation: fadeIn 0.6s ease-out;
}

/* Custom Scrollbar for Dark Theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Badge Integration Styles */
.pilot-badge {
    transform: scale(0.9); /* Slightly smaller to fit better */
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .pilot-badge {
        transform: scale(0.8);
    }
}

@media (max-width: 768px) {
    .pilot-badge {
        transform: scale(0.7);
    }
}

/* No Profile Photo Indicator */
.no-photo-indicator {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--border-color);
}

/* Footer styling */
footer {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Ensure proper z-index stacking */
.navbar {
    z-index: 1030;
}

#profileContent {
    position: relative;
    z-index: 1;
}

/* Recent Flights Table Styling */
.table-hover tbody tr:hover {
    background-color: rgba(253, 184, 19, 0.05) !important;
}

.table-sm td, .table-sm th {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

/* Button styling for flight actions */
.btn-xs {
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
    border-radius: 3px !important;
    line-height: 1.2 !important;
}

.btn-xs i {
    font-size: 0.65rem;
}

.btn-outline-primary.btn-xs {
    border-color: rgba(13, 110, 253, 0.5);
    color: #0d6efd;
}

.btn-outline-primary.btn-xs:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.btn-outline-info.btn-xs {
    border-color: rgba(13, 202, 240, 0.5);
    color: #0dcaf0;
}

.btn-outline-info.btn-xs:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: white;
}

.btn-outline-success.btn-xs {
    border-color: rgba(25, 135, 84, 0.5);
    color: #198754;
}

.btn-outline-success.btn-xs:hover {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

/* Modal styling for dark theme - Override Bootstrap */
.modal-content, 
#flightDetailsModal .modal-content,
#comLogModal .modal-content,
#flightPathModal .modal-content {
    background-color: #1a1a1a !important;
    border: 1px solid rgba(253, 184, 19, 0.3) !important;
    color: #e0e0e0 !important;
}

.modal-content.bg-dark {
    background-color: #1a1a1a !important;
}

.modal-header,
#flightDetailsModal .modal-header,
#comLogModal .modal-header,
#flightPathModal .modal-header {
    background-color: #232323 !important;
    border-bottom: 1px solid rgba(253, 184, 19, 0.2) !important;
    color: #e0e0e0 !important;
}

.modal-footer,
#flightDetailsModal .modal-footer,
#comLogModal .modal-footer,
#flightPathModal .modal-footer {
    background-color: #232323 !important;
    border-top: 1px solid rgba(253, 184, 19, 0.2) !important;
    color: #e0e0e0 !important;
}

.modal-body,
#flightDetailsModal .modal-body,
#comLogModal .modal-body,
#flightPathModal .modal-body {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

.modal .table-dark,
.modal table.table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.05) !important;
    background-color: transparent !important;
    color: #e0e0e0 !important;
}

.modal .table-dark td,
.modal .table-dark th {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0 !important;
}

.modal-backdrop {
    background-color: #000;
    opacity: 0.8 !important;
}

/* Override Bootstrap's default modal bg */
.modal .bg-dark {
    background-color: #1a1a1a !important;
}

/* Fix text colors in modals */
.modal h5, .modal h6, .modal p, .modal td, .modal th {
    color: inherit !important;
}

.modal .text-primary {
    color: #FDB813 !important;
}

.modal .text-light {
    color: #e0e0e0 !important;
}

.modal .text-muted {
    color: #999 !important;
}