/* General scoreboard styles */
.scoreboard {
    width: 98%;
    margin: 0 auto;
    text-align: center;
}

h2 {
    padding: 0.5em 0.5em 0.5em 0;
    font-size: 2.5rem;
    margin:auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: 46% 8% 46%;
    gap: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.player-header {
    font-weight: bold;
    font-size: 3.7rem;
    overflow: auto;
    max-height: 5rem;
    overflow: hidden;
}

.empty-cell {
    background-color: var(--white-background-color);
    display: flex;
}

.stat {
    padding: 10px;
    background-color:var(--white-background-color);
    border: 1px solid var(--white-background-color);
    font-size: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; 


}
.stat-details {
    border: 1px solid var(--darkslate-element-color);
    padding: 10px;
    margin: 5px;
    border-radius: 10px;
    flex: auto;
    background: var(--white-background-color);
}

.main-scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
}

.main-scores-grid .score h1 {
    font-size: 4em;
    margin: 0;
}

.score-input-container {
    height: 400px; /* Adjust this value as needed */
    overflow-y: auto;
    position: relative;
}

.score-input-grid {
    display: grid;
    grid-template-columns: 23% 23% 8% 23% 23%;
    margin-bottom: 20px;
}

.header-cell {
    color: var(--white-background-color);
    padding: 10px;
    font-weight: bold;
    height: 3rem;
    font-size: 2rem;
    background-color: var(--darkslate-element-color);

}

.score-cell,
.left-cell,
.darts-cell {
    padding: 10px;
    background-color:var(--white-background-color);
    border: 1px solid var(--darkslate-element-color);
    text-align: center;
    height: 3rem;
    font-size: 2rem;
}

.score-input-grid .darts-cell {
    background-color: #f9f9f9;
}

.score-input-grid .darts-cell:nth-child(even) {
    background-color: #f0f0f0;
}

.score-input-grid .darts-cell:nth-child(odd) {
    background-color: #fff;
}
.score-input-grid {
    margin-bottom: 20px;
}

.current-turn {
    background-color: var(--antiquewhite-element-color);
}
input[type="radio"] {
    /*make the radio buttons checkbox style*/
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    vertical-align: middle;
}

input[type="radio"]:checked {
    background-color: var(--darkslate-element-color);
    position: relative;
    cursor: not-allowed;
}

input[type="radio"]:checked::after {
    content: '\2714';
    font-size: 14px;
    color: var(--white-text-color);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="radio"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
#vs-img {
    margin: auto;
    max-width: 100%;
    max-height: 5rem;
}

.button {
    padding: 0.8em 1.7em;
    border-radius: .3em;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-weight: 700;
    font-size: 17px;
    border: 1px solid;
    font-family: inherit;
    text-transform: uppercase;
    z-index: 1;
    font-weight: bold;
    width: 100%;
    margin: auto;
}


.button:hover {
    color: var(--black-text-color);
}
.confirm-button {
    color: var(--white-text-color);
    background-color: var(--okay-color);
    border-color: var(--okay-color);
}
.cancel-button {
    color: var(--white-text-color);
    background-color: var(--error-color);
    border-color: var(--error-color);
}

/*size for screens smaller than 1400px*/
@media (max-width: 1400px) {
    .player-header {
        font-size: 3rem;
        max-height: 4rem;
    }
    .stat {
        font-size: 1rem;
    }
    .stat-details {
        padding: 5px;
        margin: 3px;
    }
    
    .main-scores-grid .score h1 {
        font-size: 3em;
    }
    
    .score-input-container {
        height: 350px; /* Adjust this value as needed */
    }
    
    .header-cell {
        padding: 8px;
        height: 2rem;
        font-size: 1.5rem;
    
    }
    
    .score-cell,
    .left-cell,
    .darts-cell {
        padding: 8px;
        height: 2rem;
        font-size: 1.5rem;
    }
        
    #vs-img {
        max-height: 4rem;
        max-width: 100%;
    }
}
@media (max-width: 1000px) {
    button {
        padding: 8px 3px;
        font-size: 0.8rem;
    }
    .stats-grid {
        display: grid;
        grid-template-columns: 44% 12% 44%;
        gap: 0px;
    }
    .player-header {
        font-size: 2rem;
    }
    .stat {
        font-size: 1rem;
    }
    .stat-details {
        padding: 5px;
        margin: 3px;
    }
}
.score-cell.disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.score-cell.disabled:hover {
    background-color: #f5f5f5;
    transform: none;
    box-shadow: none;
}

#winnerDialog {
    width: 450px;
    height: fit-content;
    background-color: var(--white-background-color);
    border: 1px solid var(--darkslate-element-color);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
}

/* Dialog backdrop styling */
dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Ensure dialogs are properly positioned */
dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    margin: 0;
}

/* Dart Limit Dialog Styles */
#dartLimitDialog {
    border: none;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background-color: var(--white-background-color);
}

#dartLimitDialog h1 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

#dartLimitDialog h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

#dartLimitDialog h4 {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.2rem;
    line-height: 1.4;
}

.winner-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.winner-btn {
    padding: 20px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
}

.player1-btn {
    background-color: #3498db;
    color: white;
}

.avg-P1, .avg-P2 {
    width: 100%;
}
.player1-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.player2-btn {
    background-color: #e74c3c;
    color: white;
}

.player2-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.winner-btn .player-name {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.winner-btn .btn-text {
    font-size: 1rem;
    opacity: 0.9;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    #dartLimitDialog {
        padding: 20px;
        margin: 20px;
    }
    
    .winner-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .winner-btn {
        min-width: auto;
        width: 100%;
    }
}

/* Checkout Drawer Styles */
.checkout-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #2f4f4f 0%, #3a5f5f 100%);
    color: white;
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.checkout-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.drawer-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

.close-drawer-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-drawer-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.drawer-content {
    padding: 20px;
}

.current-score {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.current-score span {
    color: #ffd700;
}

.checkout-combination {
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.checkout-combination h4 {
    margin: 0 0 10px 0;
    color: #ffd700;
    font-size: 1.1rem;
}

.checkout-darts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.dart-score {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

.dart-score.double {
    background: #2ecc71;
    color: white;
}

.dart-score.triple {
    background: #3498db;
    color: white;
}

.dart-score.single {
    background: #f39c12;
    color: white;
}

.dart-score.bull {
    background: #e74c3c;
    color: white;
}

.checkout-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.checkout-toggle-btn {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #2f4f4f 0%, #3a5f5f 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 25px 0 0 25px;
    cursor: pointer;
    z-index: 999;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.checkout-toggle-btn:hover {
    background: linear-gradient(135deg, #3a5f5f 0%, #2f4f4f 100%);
    transform: translateY(-50%) translateX(-5px);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.4);
}

.checkout-toggle-btn.hidden {
    right: -120px;
}

.checkout-icon {
    font-size: 1.5rem;
}

.checkout-text {
    font-size: 1rem;
}

.no-checkout {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.no-checkout h4 {
    color: #e74c3c;
    margin-bottom: 10px;
}

.more-combinations {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Mobile responsiveness for checkout drawer */
@media (max-width: 768px) {
    .checkout-drawer {
        width: 100%;
        right: -100%;
    }
    
    .checkout-toggle-btn {
        right: 10px;
        padding: 12px 15px;
        border-radius: 20px 0 0 20px;
    }
    
    .checkout-text {
        display: none;
    }
    
    .checkout-icon {
        font-size: 1.8rem;
    }
    .header-cell {
        font-size: 0.8rem;
    }
}
