/* Custom styles for Heren Golf application */

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Golf specific styling */
.navbar-brand {
    font-weight: bold;
}

.hero-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 2rem 0;
}

.card-golf {
    border-left: 4px solid #28a745;
    transition: transform 0.2s;
}

.card-golf:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.table-golf th {
    background-color: #f8f9fa;
    border-top: 2px solid #28a745;
    font-weight: 600;
}

.ranking-1 { 
    background-color: #fff3cd; 
}

.ranking-2 { 
    background-color: #f8f9fa; 
}

.ranking-3 { 
    background-color: #fff3cd; 
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    /* Better table handling on mobile */
    .table-responsive-stack {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    
    .table-standings th,
    .table-standings td {
        vertical-align: middle;
    }
    
    /* Better labels on mobile */
    [data-label] {
        position: relative;
    }
    
    /* Improve score readability */
    td .fs-5 {
        font-size: 1rem !important;
        white-space: nowrap;
    }
}

/* Stand page responsive styles */
.ranking-badge {
    display: inline-block !important;
}

.achievement-badge {
    display: inline-block !important;
    border-radius: 50rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 0.15rem;
}

@media (max-width: 767.98px) {
    /* Hide non-essential columns but keep structure */
    #standTable th:nth-child(2),
    #standTable th:nth-child(4),
    #standTable th:nth-child(5),
    #standTable th:nth-child(6),
    #standTable th:nth-child(7),
    #standTable td:nth-child(2),
    #standTable td:nth-child(4),
    #standTable td:nth-child(5),
    #standTable td:nth-child(6),
    #standTable td:nth-child(7) {
        display: none;
    }
    
    /* Ensure important columns remain visible */
    #standTable th:nth-child(1),
    #standTable th:nth-child(3),
    #standTable th:nth-child(8),
    #standTable td:nth-child(1),
    #standTable td:nth-child(3),
    #standTable td:nth-child(8) {
        display: table-cell;
    }
    
    /* Make badges and ranks more visible */
    #standTable .ranking-badge {
        display: inline-block !important;
        font-size: 0.9rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Improve score display */
    #standTable .fs-5.fw-bold.text-primary {
        font-size: 1rem !important;
    }
    
    /* Remove data labels on mobile */
    #standTable td[data-label]:before {
        display: none !important;
    }
    
    /* Show all badges on mobile */
    #standTable .achievement-badge {
        display: inline-block !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Show badges on tablet */
    #standTable .ranking-badge,
    #standTable .achievement-badge {
        display: inline-block !important;
    }
    
    /* Hide less important columns on tablet */
    #standTable th:nth-child(2),
    #standTable th:nth-child(4),
    #standTable th:nth-child(6),
    #standTable td:nth-child(2),
    #standTable td:nth-child(4),
    #standTable td:nth-child(6) {
        display: none;
    }
}

/* Score display improvements */
.score-positive {
    color: #28a745;
    font-weight: bold;
}

.score-negative {
    color: #dc3545;
    font-weight: bold;
}

.score-neutral {
    color: #6c757d;
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
}

/* Achievement badges styling */
.achievement-badge {
    display: inline-block !important;
    padding: 0.15rem 0.35rem;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    margin: 0.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.achievement-badge.birdy {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.achievement-badge.eagle {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.achievement-badge.longest {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.achievement-badge.neary {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.achievement-badge.leary {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.achievement-badge.slice {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Standings page styling */
.standings-container {
    background-color: #f5f5f5;
    border-radius: 15px;
    padding: 1rem;
}

.standings-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.standings-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.standings-title .trophy-icon {
    color: #FFD700;
    font-size: 2rem;
    margin-right: 0.5rem;
}

.standings-meta {
    color: #666;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
}

.standings-meta i {
    margin-right: 0.5rem;
}

.standings-subtitle {
    color: #6a1b9a;
    font-size: 1.3rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
}

.standings-subtitle i {
    color: #6a1b9a;
    margin-right: 0.5rem;
}

.standings-formula {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0 1.5rem 0;
}

/* Player cards styling */
.player-card {
    background-color: white;
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.position-medal {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.position-medal.gold {
    background-color: #FFD700;
}

.position-medal.silver {
    background-color: #C0C0C0;
}

.position-medal.bronze {
    background-color: #CD7F32;
}

.position-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #495057;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.player-info {
    flex: 1;
}

.player-name-link {
    color: #0d6efd;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.1rem;
}

.player-name-link:hover {
    text-decoration: underline;
}

.hcp-badge {
    display: inline-block;
    background-color: #0dcaf0;
    color: white;
    border-radius: 1rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.player-score {
    font-size: 1.3rem;
    font-weight: bold;
    color: #0d6efd;
}

.print-btn {
    background-color: white;
    border: 2px solid #28a745;
    color: #28a745;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.print-btn:hover {
    background-color: #28a745;
    color: white;
}

.print-btn i {
    margin-right: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .standings-title {
        font-size: 1.5rem;
    }
    
    .standings-subtitle {
        font-size: 1.1rem;
    }
    
    .player-name-link {
        font-size: 1rem;
    }
    
    .player-score {
        font-size: 1.2rem;
    }
    
    .position-medal,
    .position-number {
        width: 2rem;
        height: 2rem;
    }
}

@keyframes goldGlow {
    0% { text-shadow: 0 0 5px rgba(255, 215, 0, 0.3), 0 0 10px rgba(255, 215, 0, 0.2); }
    100% { text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.4); }
}

/* Footer */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Golf course colors */
.text-golf-green {
    color: #28a745;
}

.bg-golf-green {
    background-color: #28a745;
}

.border-golf-green {
    border-color: #28a745;
}

/* Dashboard specific styles */
.dashboard-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0,123,255,0.15);
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: none;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.dashboard-card .card-body {
    padding: 2rem;
}

.dashboard-icon {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.dashboard-card:hover .dashboard-icon {
    opacity: 1;
}

.dashboard-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.dashboard-card h5 {
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 1rem;
}

.dashboard-card small {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Chart container styling */
.card .card-header {
    border-bottom: none;
    font-weight: 600;
}

.card .card-body {
    padding: 1.5rem;
}

/* Large Chart Containers */
.chart-container-large {
    height: 400px;
    position: relative;
}

.chart-container-large canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Hole Chart Containers */
.hole-chart-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    min-height: 200px;
    position: relative;
}

.hole-chart-container h6 {
    font-size: 0.9rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 0.5rem;
}

.hole-chart-container canvas {
    width: 100% !important;
    height: 120px !important;
    max-height: 120px;
}

.hole-stats {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Chart responsiveness */
canvas {
    max-width: 100%;
}

/* Mobile adjustments for hole charts */
@media (max-width: 768px) {
    .hole-chart-container {
        min-height: 200px;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .hole-chart-container canvas {
        height: 120px !important;
    }
    
    .hole-chart-container h6 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .hole-stats {
        font-size: 0.8rem;
        margin-top: 0.75rem;
    }
}

@media (max-width: 576px) {
    .chart-container-large {
        height: 300px;
    }
    
    .hole-chart-container {
        min-height: 180px;
        padding: 0.5rem;
    }
    
    .hole-chart-container canvas {
        height: 100px !important;
    }
    
    .hole-chart-container h6 {
        font-size: 0.9rem;
    }
}

/* Dashboard responsive design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem;
        text-align: center;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .dashboard-card .card-body {
        padding: 1.5rem;
    }
    
    .dashboard-card h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-card h2 {
        font-size: 1.75rem;
    }
    
    .dashboard-card .card-body {
        padding: 1rem;
    }
}