﻿/* ========================================
   HOLE MODAL STYLES - STANDALONE VERSION
   Uses hardcoded colors instead of CSS variables
   ======================================== */

/* Hole Modal Content - Wider for content */
.hole-modal-content {
    max-width: 600px !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Modal Body - Scrollable */
.hole-modal-content .hcp-modal-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Modal Header - Title left, navigation buttons right */
.hole-modal-content .hcp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hole-modal-content .hcp-modal-header .header-title-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hole-modal-content .hcp-modal-header h2 {
    margin: 0;
    text-align: left;
    font-size: 2rem;
    color: var(--primary);
    font-weight: 600;
	
}

.hole-modal-content .hcp-modal-header .header-player-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secundary);
    text-align: left;
}

.hole-modal-content .hcp-modal-header .header-nav-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hole-modal-content .nav-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--brand-orange);
    border-radius: 8px;
    background: var(--brand-orange);  /* Orange */
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hole-modal-content .nav-btn:hover:not(:disabled) {
    background: var(--brand-orange);  /* Darker orange on hover */
    border-color: var(--brand-orange);
}

.hole-modal-content .nav-btn:disabled {
    opacity: 0;  /* Completely invisible when disabled */
    cursor: not-allowed;
}

.hole-modal-content .nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* ========================================
   HOLE INFO HEADER - Single line v1 layout with BLUE background
   ======================================== */
.hole-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--brand-blue);  /* Blue background */
    border-radius: 12px 12px 0px 0px;
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-align: center;
}

.hole-info-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hole-info-label {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.hole-info-value {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

/* ========================================
   SCORING SECTION - Combined box with v1 layout
   ======================================== */
.hole-scoring-section {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 0px 0px 12px 12px;
    border: 2px solid var(--border-color);
    justify-content: space-around;
}

/* Stroke Counter */
.stroke-counter {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stroke-label, 
.stableford-label {
    font-size: 20px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
}

.stroke-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stroke-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-green);  /* Green */
    line-height: 1;
    min-width: 40px;
    text-align: center;
}

.stroke-buttons {
    display: flex;
    gap: 12px;
}

.stroke-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.stroke-btn:hover {
    background: var(--brand-blue);  /* Blue on hover */
    color: white;
    border-color: var(--brand-blue);
}

.stroke-btn:active {
    transform: scale(0.95);
}

/* Stableford Display */
.stableford-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stableford-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-blue);  /* Blue */
    line-height: 1;
}

/* ========================================
   CLUB SELECTION SECTION
   ======================================== */
.club-selection-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    background: var(--brand-orange);  /* Orange header */
    padding: 12px 16px;
    margin: 0 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px 12px 0 0;
}

.hole-club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 10px;
    background: var(--bg-primary);  /* Big box background */
    padding: 10px;
    border-radius: 0 0 12px 12px;
    border: 2px solid var(--border-color);
    justify-content: space-around;
}

.hole-club-btn {
    padding: 4px;
    border: 2px solid var(--border-color);  /* Lighter border for better contrast */
    border-radius: 8px;
    background: var(--bg-card);  /* Darker background for better contrast */
    color: var(--text-primary);  /* White text */
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hole-club-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    background: var(--brand-orange);  /* Blue hover */
    border-color: var(--brand-orange);
}

/*.hole-club-btn.selected {
    background: var(--brand-orange);
    color: white;
    border-color: var(--brand-orange);
}*/

/* +1 Penalty button - Always red */
.hole-club-btn.penalty-club-btn {
    background: var(--brand-red);  /* Red */
    color: white;
    border-color: var(--brand-red);
}

.hole-club-btn.penalty-club-btn:hover {
    background: var(--brand-red);  /* Darker red on hover */
    border-color: var(--brand-red);
}

.hole-club-btn.penalty-club-btn.selected {
    background: var(--brand-red);  /* Even darker red when selected */
    border-color: var(--brand-red);
}

.no-clubs-message {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 14px;
}

/* ========================================
   SHOT LOG SECTION
   ======================================== */
.shot-log-section {
    background: rgba(71, 85, 105, 0.3);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 16px;
}

/* Shot log uses same section-title styling as club selection */

.shot-log-list {
    font-size: 20px;
    min-height: 80px;
}

.no-shots-message {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    margin: 0;
}

/* ========================================
   MODAL FOOTER BUTTONS
   Match scorecard action-buttons exactly
   ======================================== */
.hole-modal-content .hcp-modal-footer {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
}

.hole-modal-content .hcp-modal-footer .btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hole-modal-content .hcp-modal-footer .btn:active {
    transform: scale(0.98);
}

/* Button Colors */
.btn-primary {
    background: var(--brand-blue);  /* Blue - QSCORE */
    color: white;
}

.btn-primary:active {
    background: #2563eb;
}

.btn-success {
    background: var(--brand-green);  /* Green - SAVE */
    color: white;
}

.btn-success:active {
    background: var(--brand-green);
}

/* ========================================
   POSITION MODAL (Nested)
   ======================================== */
.position-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000 !important;  /* Above hole modal (99999) */
    display: flex;
    align-items: center;
    justify-content: center;
}

.position-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);  /* Semi-transparent overlay */
    cursor: pointer;
}

.position-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px var(--border-color);
    z-index: 1;
}

.position-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--brand-orange);  /* Orange background */
    border-radius: 12px 12px 0 0;
}

.position-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: white;  /* White text on orange */
}

.position-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);  /* Semi-transparent white */
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.position-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.position-modal-body {
    padding: 12px 8px;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-primary);  /* Big box background - dark gray */
}

.position-section {
    margin-bottom: 20px;
}

.position-section:last-child {
    margin-bottom: 0;
}

.position-category {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.position-btn {
    padding: 8px;
    border: 2px solid var(--border-color);  /* Lighter border for better contrast */
    border-radius: 8px;
    background: var(--bg-card);  /* Darker background for better contrast */
    color: var(--text-primary);  /* White text for dark mode */
    font-size: 22px;  /* Always 16px */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.position-btn:hover {
    background: var(--brand-orange);  /* Blue hover */
    border-color: var(--brand-orange);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.position-btn:active {
    transform: scale(0.95);
}

.position-modal-footer {
    padding: 16px 20px;
    background: var(--bg-primary);  /* Match body background */
    border-radius: 0 0 12px 12px;
}

.btn-cancel {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: #6b7280;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-cancel:hover {
    background: #4b5563;
}

.btn-cancel:active {
    transform: scale(0.98);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .hole-modal-content {
        max-width: 95% !important;
        max-height: 95vh;
    }

    .hole-info-header {
        padding: 12px;
        font-size: 20px;
    }
    
    .hole-info-label,
    .hole-info-value {
        font-size: 20px;
    }

    .hole-scoring-section {
        gap: 16px;
        padding: 12px;
    }
    
    .stroke-label,
    .stableford-label {
        font-size: 20px;
    }
    
    .stroke-value,
    .stableford-value {
        font-size: 28px;
    }

    .hole-club-grid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
        gap: 8px;
    }

    .hole-club-btn {
        padding: 4px;
        font-size: 20px;
        min-height: 44px;
    }
    
    /* Keep buttons in a row on mobile, just smaller font */
    .hole-modal-content .hcp-modal-footer .btn {
        font-size: 14px;
    }
    
    /* Position modal responsive */
    .position-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .position-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .hole-info-header {
        font-size: 22px;
        padding: 10px;
    }
    
    .hole-info-label,
    .hole-info-value {
        font-size: 22px;
    }

    .hole-scoring-section {
        padding: 10px;
        gap: 12px;
    }
    
    .stroke-label,
    .stableford-label {
        font-size: 20px;
    }

    .stroke-value,
    .stableford-value {
        font-size: 24px;
    }
    
    .stroke-btn {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .hole-club-grid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    }
    
    /* Position modal responsive */
    .position-modal-header {
        padding: 12px 16px;
    }
    
    .position-modal-header h3 {
        font-size: 20px;
    }
    
    .position-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
    
    .position-category {
        font-size: 20px;
        margin-bottom: 10px;
    }
}
/* ========================================
   QUICK ENTRY MODAL
   Large fonts for golfers without reading glasses
   ======================================== */
.quick-entry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000 !important;  /* Above hole modal */
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-entry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.quick-entry-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 500px;
    width: 95%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 20px var(--border-color);
    z-index: 1;
}

.quick-entry-modal-header {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 12px 12px 0 0;
}

.quick-entry-title-group {
    flex: 1;  /* Takes up remaining space */
    display: flex;
    flex-direction: column;
    gap: 4px;

}

.quick-entry-title-group h2,
.quick-entry-modal-header h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary);
    font-weight: 600;
}

.quick-entry-header-info {
	font-size: 20px;
    font-weight: 600;
    color: var(--text-secundary);
    text-align: left;
}

.quick-entry-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.quick-entry-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.quick-entry-modal-body {
    padding: 12px;  /* Reduced from 16px */
    overflow-y: auto;
    flex: 1;
    background: var(--bg-primary);
}

/* Players Section - Optimized for 4 players without scrolling */
.quick-entry-players {
    margin: 10px 0px 30px 0px;  /* Reduced from 24px */
}

.quick-entry-player {
    background: var(--bg-card);
    border: 2x solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    /* 2-COLUMN LAYOUT: Name left, scores right */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quick-entry-player:last-child {
    margin-bottom: 0;
}

.quick-entry-player.selected {
    border-color: var(--brand-green);
    border-width: 3px;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.quick-entry-player-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;  /* Take remaining space */
    margin-bottom: 0;  /* No margin - everything on one line */
}

.quick-entry-player-score-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quick-entry-score-input {
    width: 50px !important;
    height: 50px;
    font-size: 24px !important;
    font-weight: 700;
    text-align: center;
    border: 3px solid var(--border-color);
    border-radius: 8px;
	padding: 4px !important;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.quick-entry-score-input.selected {
    border-color: var(--brand-green);
    border-width: 3px;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* Pts section - stacked vertically */
.quick-entry-pts-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

.quick-entry-pts-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1;
}

.quick-entry-pts {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-green);
    line-height: 1;
    margin-top: 4px;
}
}

/* Number Pad Section - Optimized */
.quick-entry-section {
    margin: 20px 0px 10px;  /* Reduced from 20px */
}

.quick-entry-label {
    font-size: 14px;  /* Reduced from 18px - less emphasis on label */
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;  /* Reduced from 12px */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-entry-number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;  /* Reduced from 12px */
}

.quick-entry-number-btn {
    height: 60px;  /* Reduced from 70px - still large enough for easy tapping */
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 28px;  /* Reduced from 32px - still HUGE and readable */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Remove all hover effects - use flash only for feedback */
.quick-entry-number-btn:hover {
    /* No hover effect - flash provides feedback */
}

/* Disable hover on touch devices completely */
@media (hover: none) {
    .quick-entry-number-btn:hover {
        background: var(--bg-card) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

.quick-entry-number-btn:active {
    transform: scale(0.95);
}

.quick-entry-modal-footer {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
	border-radius: 0px 0px 12px 12px;
    background: var(--bg-primary);
}

.quick-entry-modal-footer .btn {
    flex: 1;
    height: 46px;  /* Reduced from 50px */
    font-size: 20px;  /* Reduced from 18px - still readable */
    font-weight: 700;
}

/* ========================================
/* Flash effect for number button click feedback */
.quick-entry-number-btn.flash-active {
    background: var(--brand-green) !important;
    border-color: var(--brand-green) !important;
    color: white !important;
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
}

/* Quick Entry Navigation Buttons - Orange like Hole Modal */
#quick-entry-nav-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

#quick-entry-nav-group .nav-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--brand-orange);
    border-radius: 8px;
    background: var(--brand-orange);  /* Orange */
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#quick-entry-nav-group .nav-btn:hover:not(:disabled) {
    background: var(--brand-orange);  /* Darker orange on hover */
    border-color: var(--brand-orange);
}

#quick-entry-nav-group .nav-btn:disabled {
    opacity: 0;  /* Completely invisible when disabled */
    cursor: not-allowed;
}

#quick-entry-nav-group .nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* ========================================
   SHOT LOG STYLES
   ======================================== */

.shot-log-section {
    margin-top: 16px;
}

.shot-log-header {
    color: var(--brand-green);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.shot-log-empty {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 12px;
    text-align: center;
    font-style: italic;
    opacity: 0.6;
}

.shot-log-item {
    display: flex;
    align-items: center;
    border-left: 4px solid var(--brand-green);
    background: var(--bg-card);
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
    font-size: 22px;
    transition: all 0.2s ease;
}

.shot-log-item:hover {
    filter: brightness(1.1);
}

.shot-log-number {
    background: rgba(76, 175, 80, 0.15);
    color: var(--brand-green);
    font-weight: 600;
    padding: 12px 8px;
    min-width: 45px;
    display: flex;
    align-items: center;
}

.shot-log-details {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    flex: 1;
}

.shot-club,
.shot-position {
    color: var(--text-primary);
    font-weight: 500;
}

.shot-separator {
    color: var(--text-primary);
    opacity: 0.5;
}

.shot-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secundary);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 24px;
    font-weight: 700;
	opacity: 0.6;
    line-height: 1;
    transition: all 0.2s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shot-delete-btn:hover {
    opacity: 0.6;
    color: var(--brand-secundary);
}

.shot-delete-btn:active {
    transform: scale(1.05);
}
/* ========================================
   GPS LOADING SPINNER
   ======================================== */

.gps-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
}

.spinner-content {
    text-align: center;
    color: var(--text-primary);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 16px;
    border: 4px solid rgba(76, 175, 80, 0.2);
    border-top: 4px solid var(--brand-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.spinner-content p {
    color: var(--brand-green);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* Shot distance display */
.shot-distance {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 400;
    margin-left: 4px;
}