/* Mobile-optimized Golf Scoring App Styles */

/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    padding-bottom: 70px; /* Space for fixed bottom actions */
    background-color: #f8f9fa;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Card styling improvements */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

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

.card-header {
    background: linear-gradient(to right, #28a745, #20c997);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 15px 20px;
    font-weight: 500;
}

.card-header.bg-primary {
    background: linear-gradient(to right, #007bff, #17a2b8);
}

.card-header.bg-info {
    background: linear-gradient(to right, #17a2b8, #20c997);
}

/* Score legend */
.score-legend {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-item {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: white;
    font-weight: 500;
}

/* Enhanced hole header */
.hole-header {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 15px;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.hole-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.hole-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin-right: 15px;
    color: #333;
}

.hole-details {
    display: flex;
    flex-direction: column;
}

.hole-par {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.hole-yards {
    font-size: 0.9rem;
    color: #666;
}

.hole-handicap {
    font-size: 0.9rem;
    color: #666;
}

/* Improved hole navigation */
.hole-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    scrollbar-width: none; /* Firefox */
    margin-bottom: 10px;
}

.hole-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.btn-group-scroll {
    display: inline-flex;
    gap: 5px;
    padding-bottom: 5px;
}

.hole-nav .btn {
    min-width: 40px;
    height: 40px;
    border-radius: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.2s ease;
}

.hole-nav .btn-primary {
    background-color: #28a745;
    border-color: #28a745;
}

.hole-nav .btn-outline-secondary {
    color: #555;
    border-color: #ddd;
}

.hole-nav .btn-outline-success {
    color: #28a745;
    border-color: #28a745;
}

.hole-nav .prev-next-btn {
    min-width: 80px;
}

/* Team card improvements */
.team-card {
    margin-bottom: 20px;
    overflow: hidden;
}

.team-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-card .card-header h5 {
    margin: 0;
    font-weight: 600;
}

.player-row {
    transition: background-color 0.2s ease;
}

.player-row:hover {
    background-color: #f8f9fa;
}

.player-name {
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* Enhanced score inputs */
.score-input-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-input-small {
    height: 50px;
    width: 60px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.score-input-small:focus {
    background-color: #fff;
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Score relative to par indicators */
.score-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Score colors */
.score-double-eagle,
.score-eagle {
    background-color: #7b68ee; /* Purple for eagle or better */
}

.score-birdie {
    background-color: #28a745; /* Green for birdie */
}

.score-par {
    background-color: #6c757d; /* Gray for par */
}

.score-bogey {
    background-color: #fd7e14; /* Orange for bogey */
}

.score-double-bogey {
    background-color: #dc3545; /* Red for double bogey */
}

.score-triple-bogey {
    background-color: #9f0518; /* Darker red for triple bogey+ */
}

/* Enhanced handicap mark */
.handicap-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    margin-left: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Bottom action buttons */
.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 15px;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    z-index: 1000;
}

.bottom-actions .btn {
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 8px;
}

/* Loading animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Score summary enhancements */
.player-score-summary {
    padding: 15px;
    border-radius: 10px;
    background-color: #f8f9fa;
    margin-bottom: 15px;
}

.player-score-summary .player-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.score-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.score-stat {
    flex: 1 0 calc(33% - 10px);
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.score-stat .value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #28a745;
}

.score-stat .label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

/* Icon success animation */
.icon-success {
    animation: successPulse 2s forwards;
}

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

/* Team name form */
.team-name-form {
    max-width: 200px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .hole-number {
        font-size: 1.8rem;
    }
    
    .score-input-small {
        height: 45px;
        width: 50px;
        font-size: 1.1rem;
    }
    
    .hole-nav .btn {
        min-width: 35px;
        height: 35px;
    }
    
    .score-stat {
        flex: 1 0 calc(50% - 10px);
    }
}

/* Dark mode support */
.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .card {
    background-color: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dark-mode .card-body {
    background-color: #1e1e1e;
}

.dark-mode .card-header {
    background: linear-gradient(to right, #1e8e3e, #0d9373);
}

.dark-mode .card-header.bg-primary {
    background: linear-gradient(to right, #0366d6, #1780aa);
}

.dark-mode .card-header.bg-info {
    background: linear-gradient(to right, #1780aa, #0d9373);
}

.dark-mode .hole-header {
    background-color: #1e1e1e;
}

.dark-mode .hole-number {
    color: #e0e0e0;
}

.dark-mode .score-input-small {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.dark-mode .score-input-small:focus {
    background-color: #333;
    border-color: #28a745;
}

.dark-mode .table {
    color: #e0e0e0;
}

.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .table-light, 
.dark-mode .table-light > td, 
.dark-mode .table-light > th {
    background-color: #2d2d2d;
}

.dark-mode .bg-light {
    background-color: #2d2d2d !important;
}

.dark-mode .text-muted {
    color: #adb5bd !important;
}

.dark-mode .score-legend {
    background-color: #2d2d2d;
    border-color: #444;
}

.dark-mode .player-score-summary {
    background-color: #2d2d2d;
}

.dark-mode .score-stat {
    background-color: #333;
}

.dark-mode .bottom-actions {
    background-color: #1e1e1e;
}
/* Popover Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 5px;
    max-width: 500px;
    width: 90%;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.modal-header {
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-body {
    margin-bottom: 20px;
    text-align: left;
}

.modal-footer {
    display: flex;
    justify-content: center;
}

.modal-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.modal-button:hover {
    background-color: #2980b9;
}