﻿
/* Overlay */
.scoreSubOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .scoreSubOverlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Side Panel */
.scoreSubSidePanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: #F7F8FA;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

    .scoreSubSidePanel.active {
        transform: translateX(0);
    }

/* Panel Header */
.scoreSubPanelHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #1775FF 0%, #0056D2 100%);
    color: white;
    flex-shrink: 0;
}

.scoreSubPanelTitle {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.scoreSubPanelClose {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2.25rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .scoreSubPanelClose:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }

/* Content Area */
.scoreSubContentArea {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
}

/* Section */
.scoreSubSection {
    background: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.scoreSubSectionHeader {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .scoreSubSectionHeader:hover {
        background-color: #f9fafb;
    }

.scoreSubSectionTitle {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1f2937;
}

.scoreSubChevron {
    font-size: 1.4rem;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.scoreSubSectionHeader.active .scoreSubChevron {
    transform: rotate(180deg);
}

.scoreSubSectionContent {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

    .scoreSubSectionContent.active {
        max-height: 1200px;
        padding: 0 1.5rem 1rem 1.5rem;
    }

/* Team Sections */
.scoreSubTeamSection {
    margin-bottom: 1.5rem;
}

    .scoreSubTeamSection:last-child {
        margin-bottom: 0;
    }

.scoreSubTeamHeader {
    font-size: 1.4rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
    letter-spacing: 0.05em;
    text-align: left;
}

/* Partner Cards */
.scoreSubPlayerCard {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #eff2fa;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .scoreSubPlayerCard:last-child {
        margin-bottom: 0;
    }

    .scoreSubPlayerCard:hover {
        background: #eef0f2;
    }

/* Current User Card (Locked) */
.scoreSubCurrentUserCard {
    background: linear-gradient(135deg, #EBF4FF 0%, #E0EDFF 100%);
    border: 2px solid #1775FF;
    cursor: default !important;
}

    .scoreSubCurrentUserCard:hover {
        background: linear-gradient(135deg, #EBF4FF 0%, #E0EDFF 100%);
    }

.scoreSubCurrentUserAvatar {
    background: #1775FF;
    color: white;
}

.scoreSubCurrentUserText {
    color: #1775FF !important;
    font-weight: 600 !important;
}

.scoreSubLockedBadge {
    width: 32px;
    height: 32px;
    background: #1775FF;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Doubles Only Elements */
.scoreSubDoublesOnly {
    display: none;
    /*opacity: 0;*/
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scoreSubDoublesOnly.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.scoreSubPlayerAvatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 2rem;
    flex-shrink: 0;
    overflow: hidden;
}

    .scoreSubPlayerAvatar img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }

.scoreSubPlayerText {
    flex: 1;
    font-size: 1.5rem;
    color: #585e6a;
    font-weight: 500;
    text-align: left;
}

.scoreSubPlayerCard.selected .scoreSubAddButton {
    display: none;
}

.scoreSubAddButton {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 2px solid #9aa4b7;
    color: #585e6a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .scoreSubAddButton:hover {
        background: #1775FF;
        border-color: #1775FF;
        color: white;
    }

/* Toggle Groups */
.scoreSubToggleGroup {
    margin-bottom: 1.5rem;
}

    .scoreSubToggleGroup:last-child {
        margin-bottom: 0;
    }

.scoreSubToggleLabel {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* Ranking Description */
.scoreSubRankingDesc {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #E5E7EB;
}

.scoreSubRankingDescRow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    color: #374151;
}

    .scoreSubRankingDescRow i {
        font-size: 1.4rem;
        width: 20px;
        text-align: center;
    }

    .scoreSubRankingDescRow strong {
        color: #1f2937;
        font-weight: 600;
    }

/* Segmented Control */
.scoreSubGameTypeControl {
    display: flex;
    gap: 0.5rem;
}

.scoreSubGameCategoryButton,
.scoreSubGameTypeButton {
    flex: 1;
    padding: 0.4rem 1.5rem;
    background: white;
    border: 2px solid #d1d5db;
    color: #6b7280;
    font-size: 1.5rem;
    font-weight: 500;
    border-radius: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .scoreSubGameCategoryButton:hover,
    .scoreSubGameTypeButton:hover {
        border-color: #1775FF;
    }

    .scoreSubGameCategoryButton.active,
    .scoreSubGameTypeButton.active {
        background: #1775FF;
        border-color: #1775FF;
        color: white;
    }

/* Score Buttons */
.scoreSubGameCategoryButtons,
.scoreSubScoreButtons {
    display: flex;
    gap: 0.75rem;
}

.scoreSubGameCategoryButton,
.scoreSubScoreButton {
    flex: 1;
    padding: 0.4rem 1rem;
    background: white;
    border: 2px solid #d1d5db;
    color: #6b7280;
    font-size: 1.6rem;
    font-weight: 600;
    border-radius: 3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .scoreSubGameCategoryButton:hover,
    .scoreSubScoreButton:hover {
        border-color: #1775FF;
    }

    .scoreSubGameCategoryButton.active,
    .scoreSubScoreButton.active {
        background: #1775FF;
        border-color: #1775FF;
        color: white;
    }

/* Footer */
.scoreSubFooter {
    padding: 1.25rem 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.scoreSubSubmitButton {
    width: 100%;
    padding: 0.5rem 2rem;
    background: #1775FF;
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(23, 117, 255, 0.3);
    transition: all 0.3s ease;
}

    .scoreSubSubmitButton:hover {
        background: #0056D2;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(23, 117, 255, 0.4);
    }

    .scoreSubSubmitButton:active {
        transform: translateY(0);
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .scoreSubSidePanel {
        width: 100%;
        max-width: 100vw;
    }

    .scoreSubPanelTitle {
        font-size: 1.5rem;
    }

    .scoreSubSectionTitle {
        font-size: 1.5rem;
    }

    .scoreSubPlayerAvatar {
        width: 30px;
        height: 30px;
        font-size: 1.5rem;
    }

    .scoreSubPlayerText {
        font-size: 1.4rem;
    }

    .scoreSubToggleLabel {
        font-size: 1.3rem;
    }

    .scoreSubGameTypeButton,
    .scoreSubGameCategoryButton,
    .scoreSubScoreButton {
        font-size: 1.4rem;
    }

    .scoreSubSubmitButton {
        font-size: 1.5rem;
    }
}

/* Score Entry Section Styles */

/* Player Names Row */
.scoreSubPlayerNamesRow {
    margin-bottom: 0.75rem;
}

.scoreSubPlayerNamesGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.scoreSubPlayerNameCell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 1rem;
    background: #F7F8FA;
    border-radius: 3rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.scoreSubTeam1Color {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}

.scoreSubTeam2Color {
    border-color: #ef4444;
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
}

.scoreSubPlayerNameDot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.scoreSubTeam1,
.scoreSubTeam2 {
    margin-bottom: 0.75rem;
    background: unset;
}

.scoreSubTeam1 .scoreSubPlayerNameDot,
.scoreSubTeam1Color .scoreSubPlayerNameDot {
    background: #3b82f6;
}

.scoreSubTeam2 .scoreSubPlayerNameDot,
.scoreSubTeam2Color .scoreSubPlayerNameDot {
    background: #ef4444;
}

.scoreSubPlayerNameText {
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
    text-align: left;
}

/* Sets Container */
.scoreSubSetsContainer {
    margin-bottom: 1.25rem;
}

.scoreSubSetRow {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    align-items: center;
    margin-bottom: 0.75rem;
}

    .scoreSubSetRow:last-child {
        margin-bottom: 0;
    }

.scoreSubSetHeader {
    display: flex;
    align-items: center;
    justify-content: start;
}

.scoreSubSetLabel {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
}

.scoreSubRemoveSetBtn {
    background: #ef4444;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

    .scoreSubRemoveSetBtn:hover {
        background: #ef4444;
        color: white;
    }

    .scoreSubRemoveSetBtn.scoreSubHidden {
        display: none;
    }

.scoreSubSetInputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.scoreSubSetInput {
    width: 60px;
    height: 35px;
    text-align: center;
    font-size: 1.7rem;
    font-weight: 600;
    border: 2px solid #d1d5db;
    border-radius: 3rem;
    background: white;
    transition: all 0.2s ease;
}

    .scoreSubSetInput:focus {
        outline: none;
        border-color: #1775FF;
        box-shadow: 0 0 0 3px rgba(23, 117, 255, 0.1);
    }

    .scoreSubSetInput.is-invalid {
        border-color: #ef4444;
        background: #fef2f2;
    }

.scoreSubTeam1Input {
    border-color: #3b82f6;
}

    .scoreSubTeam1Input:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.scoreSubTeam2Input {
    border-color: #ef4444;
}

    .scoreSubTeam2Input:focus {
        border-color: #dc2626;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    }

.scoreSubSetRemoveBtns {
    display: flex;
    align-items: center;
    justify-content: end;
}

.scoreSubSetSeparator {
    font-size: 1.8rem;
    font-weight: 600;
    color: #6b7280;
}

/* Add Set Button */
.scoreSubAddSetBtn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px dashed #d1d5db;
    color: #6b7280;
    font-size: 1.5rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

    .scoreSubAddSetBtn:hover {
        background: #f9fafb;
        border-color: #1775FF;
        color: #1775FF;
    }

    .scoreSubAddSetBtn i {
        font-size: 1.4rem;
    }

/* Tie Error Message */
.scoreSubTieError {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px solid #F59E0B;
    border-radius: 10px;
    padding: 1rem 1.5rem 0;
    margin-bottom: 0.5rem;
    text-align: center;
}

.scoreSubTieErrorIcon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

    .scoreSubTieErrorIcon i {
        animation: bounce 1s infinite;
    }

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.scoreSubTieErrorContent {
    width: 100%;
    margin-bottom: 0.5rem;
}

    .scoreSubTieErrorContent strong {
        display: block;
        font-size: 1.6rem;
        font-weight: 700;
        color: #92400E;
        margin-bottom: 0.25rem;
    }

.scoreSubTieErrorList {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.3rem;
    color: #78350F;
    line-height: 1.2;
}

/* Super Tie-Break Section */
.scoreSubSuperTieSection {
    margin-top: 0.5rem;
}

.scoreSubSuperTieCheckbox {
    text-align: center;
    margin-bottom: 1rem;
}

.scoreSubCheckboxInput {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1775FF;
}

    .scoreSubCheckboxInput:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

.scoreSubCheckboxLabel {
    font-size: 1.5rem;
    font-weight: 500;
    color: #374151;
    margin: 0rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

.scoreSubSuperTieHint {
    font-size: 1.1rem;
    color: #6b7280;
}

.scoreSubSuperTieInputs {
    margin-top: 1rem;
}

.scoreSubSuperTieInputRow {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.scoreSubSuperTieLabel {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.scoreSubSuperTieInputsGroup {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

.scoreSubSuperTieInput {
    width: 60px;
    height: 35px;
    text-align: center;
    font-size: 1.7rem;
    font-weight: 600;
    border: 2px solid #F59E0B;
    border-radius: 3rem;
    background: #FFFBEB;
    transition: all 0.2s ease;
}

    .scoreSubSuperTieInput:focus {
        outline: none;
        border-color: #D97706;
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    }

    .scoreSubSuperTieInput.is-invalid {
        border-color: #ef4444;
        background: #fef2f2;
    }

.scoreSubSuperTieError {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-size: 1.3rem;
    color: #dc2626;
    text-align: center;
}

/* Scrollbar Styling */
.scoreSubContentArea::-webkit-scrollbar {
    width: 6px;
}

.scoreSubContentArea::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.scoreSubContentArea::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

    .scoreSubContentArea::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

/* Prevent body scroll when panel is open */
body.scoreSubPanelOpen {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

html.scoreSubPanelOpen {
    overflow: hidden !important;
}