/* Pool Match Entry - Styles */
/* Match Entry Module for Pool Hub */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 10px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.header {
    background: #374151;
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #4b5563;
}

.header h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.match-form {
    background: #374151;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid #4b5563;
}

.form-header {
    background: #4b5563;
    color: white;
    padding: 15px;
    margin: -20px -20px 20px -20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.match-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.date-time-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.date-time-row .form-group {
    width: 100%;
}

.break-info-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .date-time-row {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        max-width: 620px;
        margin: 0 auto;
    }

    .date-time-row .form-group {
        width: 280px;
        flex-shrink: 0;
    }

    .break-info-row {
        grid-template-columns: 1fr;
        justify-content: center;
        justify-items: center;
        max-width: 400px;
        margin: 0 auto;
    }
}

.players-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .players-section {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

.player-stats-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.player-stats-row + .player-stats-row {
    margin-bottom: 5px;
}

.player-stats-row .form-group {
    margin-bottom: 5px;
}

@media (min-width: 768px) {
    .player-stats-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .player-stats-row.four-col {
        grid-template-columns: repeat(4, 1fr);
    }
}

.player-card {
    background: #4b5563;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #6b7280;
}

.player-card.winner {
    border-color: #10b981;
    background: #374151;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.player-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
}

.win-loss-record {
    font-size: 1.2rem;
    color: #9ca3af;
    font-weight: normal;
}

.win-loss-record .better-record {
    color: #10b981;
    font-weight: bold;
}

.drink-icon {
    font-size: 1.1rem;
    margin: 0 5px;
}

.player-header.player2 {
    flex-direction: row-reverse;
}

.player-header.player2 h3 {
    text-align: right;
}

.winner-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    min-height: 48px;
    font-size: 16px;
    width: 100%;
    margin: 15px 0;
}

.winner-btn:hover {
    background: #059669;
}

.winner-btn.selected {
    background: #059669;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.refresh-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    margin-left: 8px;
    vertical-align: middle;
    min-width: 32px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: #2563eb;
    transform: rotate(90deg);
}

.refresh-btn:active {
    transform: rotate(180deg);
}

.refresh-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #d1d5db;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #6b7280;
    border-radius: 8px;
    font-size: 16px;
    background: #374151;
    color: #ffffff;
    min-height: 48px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.form-group textarea {
    height: 80px;
    resize: vertical;
    min-height: 80px;
}

.required {
    color: #ef4444;
}

.checkbox-input {
    width: 100%;
    border: 1px solid #6b7280;
    border-radius: 8px;
    background: #374151;
    min-height: 48px;
    max-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.checkbox-input input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #10b981;
    cursor: pointer;
    margin: 0;
}

.checkbox-input:focus-within {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.match-info .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #374151;
    border: 1px solid #6b7280;
    border-radius: 8px;
    min-height: 48px;
}

.break-info-row .checkbox-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.break-info-row .checkbox-item label {
    color: #d1d5db;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    display: block;
}

.break-info-row .checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #374151;
    border: 1px solid #6b7280;
    border-radius: 8px;
    min-height: 48px;
}

.break-info-row .checkbox-wrapper span {
    color: #d1d5db;
    font-size: 14px;
    cursor: pointer;
}

.match-info .checkbox-item label,
.break-info-row .checkbox-item label {
    color: #d1d5db;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 0;
}

.match-info .checkbox-item input[type="checkbox"],
.break-info-row .checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #10b981;
    cursor: pointer;
    min-height: auto;
}

.match-details {
    background: #4b5563;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #6b7280;
}

.match-details h3 {
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3rem;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Responsive checkbox grid */
@media (min-width: 768px) {
    .checkbox-group {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media (max-width: 767px) and (min-width: 480px) {
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 479px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 6px;
}

.checkbox-item label {
    color: #d1d5db;
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #10b981;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-item.disabled {
    opacity: 0.5;
}

.checkbox-item.disabled label {
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

@media (min-width: 480px) {
    .form-actions {
        flex-direction: row;
    }
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    min-height: 48px;
    font-weight: 600;
}

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

.center-action-group .btn {
    flex: 1 1 0;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

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

.btn-secondary {
    background: #6b7280;
    color: white;
}

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

.recent-matches {
    margin-top: 40px;
    text-align: center;
}

.recent-matches h2 {
    color: #ffffff;
    margin-bottom: 30px;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.matches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 20px;
    justify-items: center;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
}

@media (min-width: 768px) {
    .matches-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

.match-card {
    background: #374151;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border-left: 6px solid #3b82f6;
    border: 1px solid #4b5563;
    width: 100%;
    max-width: 450px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.match-date {
    font-size: 16px;
    color: #9ca3af;
    margin-bottom: 15px;
    font-weight: 500;
}

.match-result {
    font-size: 18px;
    margin-bottom: 12px;
    color: #ffffff;
    line-height: 1.4;
}

.winner-name {
    color: #10b981;
    font-weight: bold;
    font-size: 1.1em;
}

.loser-name {
    color: #ef4444;
    font-size: 1.1em;
}

.game-type {
    background: #4b5563;
    color: #d1d5db;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    display: inline-block;
    font-weight: 600;
    align-self: flex-start;
}

.error {
    background: #dc2626;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #ef4444;
    font-size: 14px;
}

.success {
    background: #059669;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #10b981;
    font-size: 14px;
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 0 5px;
    }

    .match-form {
        padding: 15px;
    }

    .form-header {
        margin: -15px -15px 15px -15px;
    }

    .player-card {
        padding: 12px;
    }

    .match-details {
        padding: 15px;
    }

    .match-card {
        padding: 20px;
        min-height: 120px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .winner-btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .new-match-btn:hover {
        transform: scale(0.98);
    }
}

.player-stats-row.name-and-break {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .player-stats-row.name-and-break {
        grid-template-columns: auto 1fr 1fr;
        align-items: end;
    }
}

.player-had-break-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.had-break-label {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 8px;
    white-space: nowrap;
}

input[type="checkbox"].had-break-checkbox {
    width: 16px !important;
    height: 16px !important;
    cursor: pointer;
    accent-color: #3b82f6;
    margin: 0;
    padding: 16px;
}

.money-winner-section {
    background: #374151;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #4b5563;
}

.winner-buttons-section {
    background: #374151;
    border-radius: 8px;
    padding: 15px 20px;
    border: 1px solid #4b5563;
    margin-top: 10px !important;
}

.winner-field-section label {
    color: #ffd700 !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.winner-field-section input {
    background: #4b5563 !important;
    border: 2px solid #ffd700 !important;
    color: #ffd700 !important;
    font-size: 1.1rem !important;
}

@media (max-width: 768px) {
    .money-winner-section {
        display: block !important;
        grid-template-columns: none !important;
    }

    .winner-buttons-section {
        display: block !important;
        grid-template-columns: none !important;
    }

    .player1-money-section,
    .player2-money-section,
    .winner-field-section,
    .player1-winner-section,
    .player2-winner-section {
        margin-bottom: 15px;
    }

    .center-spacer {
        display: none;
    }

    .winner-field-section {
        order: -1;
    }
}

.number-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #6b7280;
    border-radius: 8px;
    background: #374151;
    width: 100%;
    min-height: 48px;
}

.number-input-wrapper:focus-within {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.number-input-btn {
    background: #4b5563;
    color: white;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 46px;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s;
}

.number-input-btn:hover {
    background: #6b7280;
}

.number-input-btn.decrement {
    border-radius: 7px 0 0 7px;
    border-right: 1px solid #6b7280;
}

.number-input-btn.increment {
    border-radius: 0 7px 7px 0;
    border-left: 1px solid #6b7280;
}

.number-input-wrapper input[type="number"] {
    width: 100%;
    flex-grow: 1;
    padding: 12px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    background: transparent;
    color: #ffffff;
    min-height: 46px;
    text-align: center;
    font-weight: bold;
    -webkit-appearance: none;
    margin: 0;
    -moz-appearance: textfield;
}

.number-input-wrapper input[type="number"]:focus {
    outline: none;
    box-shadow: none;
}

