/* Dashboard Styles - Compact Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2d3748;
    font-size: 14px;
}

/* Global compact spacing */
.container-fluid {
    padding: 0.75rem;
}

.row {
    margin-bottom: 1rem;
}

.card {
    border-radius: 10px;
}

.card-body {
    padding: 1rem;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* Improve text readability */
.text-muted {
    color: #4a5568 !important; /* Darker gray for better readability */
}

small.text-muted {
    color: #5a6270 !important; /* Even more readable for small text */
}

.card .text-muted {
    color: #4a5568 !important;
}

/* Loading Screen */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

/* Swimmer Header - More Compact */
.swimmer-header-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.swimmer-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    line-height: 1.2;
    color: white !important;
}

.swimmer-name span {
    color: inherit !important;
}

.swimmer-details .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

.swimmer-stats {
    text-align: center;
}

.stat-item {
    display: inline-block;
    margin: 0 0.75rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #FFD700;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Performance Cards - More Compact */
.stat-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.stat-card-gold .stat-number {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-card-silver {
    background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
    color: white;
}

.stat-card-silver .stat-number {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-card-bronze {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
}

.stat-card-bronze .stat-number {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.stat-card-performance {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.stat-card-performance .stat-number {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Fix text-muted in stat cards to be visible */
.stat-card .text-muted {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Fix stat-label colors in medal cards to be white */
.stat-card .stat-label,
.swimmer-header-card .stat-label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Fix medal timeline text visibility */
.medal-timeline .text-muted {
    color: #5a6270 !important;
}

/* Fix recent medal text visibility */
.recent-medals .text-muted {
    color: #5a6270 !important;
}

.stat-card .card-body {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.stat-icon {
    font-size: 1.8rem;
    margin-right: 0.75rem;
    opacity: 0.8;
}

.stat-content .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
    line-height: 1.1;
}

.stat-content .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Navigation Tabs - More Compact */
.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: #007bff;
    background-color: #f8f9fa;
}

/* Medal Timeline - More Compact */
.medal-timeline {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.75rem;
}

.timeline-item {
    display: flex;
    margin-bottom: 1rem;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: -15px;
    width: 2px;
    background: #e9ecef;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.timeline-marker-gold {
    background: linear-gradient(45deg, #FFD700, #FFA500);
}

.timeline-marker-silver {
    background: linear-gradient(45deg, #C0C0C0, #A9A9A9);
}

.timeline-marker-bronze {
    background: linear-gradient(45deg, #CD7F32, #8B4513);
}

.timeline-marker-unknown {
    background: linear-gradient(45deg, #6c757d, #495057);
}

.timeline-content {
    flex: 1;
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 3px;
}

/* Recent Medals */
.recent-medals {
    max-height: 300px;
    overflow-y: auto;
}

.recent-medal-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.recent-medal-item:hover {
    background: #e9ecef;
}

.medal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: white;
}

.medal-gold {
    background: linear-gradient(45deg, #FFD700, #FFA500);
}

.medal-silver {
    background: linear-gradient(45deg, #C0C0C0, #A9A9A9);
}

.medal-bronze {
    background: linear-gradient(45deg, #CD7F32, #8B4513);
}

.medal-unknown {
    background: linear-gradient(45deg, #6c757d, #495057);
}

/* Personal Records */
.record-stroke-section {
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    background: white;
}

.stroke-title {
    color: #007bff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.pool-type-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
}

.pool-type-title {
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.records-grid {
    display: grid;
    gap: 0.75rem;
}

.record-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.record-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.record-distance {
    font-weight: 600;
    color: #007bff;
    font-size: 0.9rem;
}

.record-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
}

.record-date {
    font-size: 0.8rem;
}

/* Performance Statistics */
.performance-stats {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #6c757d;
}

.stat-value {
    font-weight: 700;
    color: #2d3748;
}

/* Competition History */
.competition-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.competition-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.competition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.competition-name {
    color: #007bff;
    font-weight: 600;
    margin: 0;
}

.competition-stats .badge {
    font-size: 0.8rem;
}

/* Chart containers */
canvas {
    max-height: 400px;
}

/* Compact Professional Layout */
.swimmer-header-card .card-body {
    padding: 1.25rem;
}

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

.card h5 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* Reduce section spacing */
.section-header {
    margin-bottom: 0.75rem;
}

/* Responsive Design - More Compact */
@media (max-width: 768px) {
    .swimmer-name {
        font-size: 1.5rem;
    }
    
    .stat-card .card-body {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 0.25rem;
        font-size: 1.5rem;
    }
    
    .timeline-item {
        flex-direction: column;
        margin-bottom: 0.75rem;
    }
    
    .timeline-marker {
        align-self: flex-start;
        margin-bottom: 0.25rem;
    }
    
    .competition-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .competition-stats {
        margin-top: 0.25rem;
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation Classes */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideInUp 0.6s ease-out;
}

/* Print Styles */
@media print {
    .navbar,
    .loading-overlay {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .stat-card {
        background: white !important;
        color: black !important;
    }
}