/* ===========================
   Beverbende Scorekaart Styling
   =========================== */

/* CSS Variables */
:root {
    --color-sky: #00b7ed;
    --color-grass: #c4cf1c;
    --color-orange: #FF6B35;
    --color-winner: #4CAF50;
    --color-text: #333333;
    --color-white: #FFFFFF;
    --color-light-gray: #f5f5f5;
    --color-border: #ddd;
    --color-hover: rgba(0, 0, 0, 0.05);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    background: linear-gradient(to bottom, var(--color-sky) 0%, var(--color-sky) 30%, var(--color-grass) 30%, var(--color-grass) 100%);
    min-height: 100vh;
    color: var(--color-text);
}

/* Header */
.header {
    background-color: var(--color-sky);
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
}

.logo {
    height: 60px;
    width: auto;
}

.header h1 {
    color: var(--color-white);
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

/* Add Player Inline */
.add-player-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 300px;
}

.add-player-inline input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.add-player-inline input:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background-color: var(--color-orange);
    color: var(--color-white);
}

.btn-secondary {
    background-color: #666;
    color: var(--color-white);
}

.btn-cancel {
    background-color: #999;
    color: var(--color-white);
}

.btn-complete {
    background-color: var(--color-winner) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.6);
    }
}

.btn-delete {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px 10px;
    transition: all 0.2s ease;
    box-shadow: none;
}

.btn-delete:hover {
    color: #c0392b;
    transform: scale(1.2);
    box-shadow: none;
}

/* Table Container */
.table-container {
    background-color: var(--color-white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

/* Score Table */
.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.score-table thead th {
    background-color: var(--color-orange);
    color: var(--color-white);
    padding: 12px;
    text-align: center;
    font-weight: bold;
    border: 2px solid var(--color-white);
}

.score-table thead th:first-child {
    text-align: left;
    border-top-left-radius: 8px;
}

.score-table thead th:last-child {
    border-top-right-radius: 8px;
}

.score-table tbody td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--color-border);
}

.score-table tbody td:first-child {
    text-align: left;
    font-weight: bold;
}

.score-table tbody tr {
    /* Removed hover effect for better click performance */
}

/* Player Name Cell */
.player-name-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.player-name {
    cursor: pointer;
    flex: 1;
    padding: 5px;
    border-radius: 4px;
}

/* Score Cell */
.score-cell {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    height: 44px;
    padding: 0 !important;
    vertical-align: middle;
    /* Removed hover effect for better click performance */
}

/* Score Input - Always visible in every cell */
.score-input-compact {
    width: 100%;
    height: 44px;
    line-height: 44px;
    border: none;
    outline: none;
    background: none;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    padding: 0;
    margin: 0;
    font-family: inherit;
    box-sizing: border-box;
    display: block;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

/* Remove number input spin buttons */
.score-input-compact::-webkit-outer-spin-button,
.score-input-compact::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Total Cell */
.total-cell {
    font-weight: bold;
    font-size: 1.1rem;
    background-color: var(--color-light-gray) !important;
}

/* Winner Row */
.winner-row {
    background-color: var(--color-winner) !important;
}

.winner-row td {
    color: var(--color-white);
    font-weight: bold;
}

.winner-row .total-cell {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.crown-icon {
    color: #FFD700;
    margin: 0 5px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state-hint {
    font-size: 0.9rem;
    color: #bbb;
}

.hidden {
    display: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--color-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--color-text);
    text-align: center;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 20px;
    font-family: inherit;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--color-orange);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons .btn {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .logo {
        height: 45px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .add-player-inline {
        width: 100%;
        min-width: auto;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .score-table {
        font-size: 0.9rem;
    }

    .score-table thead th,
    .score-table tbody td {
        padding: 8px 4px;
    }

    .table-container {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }

    .logo {
        height: 35px;
    }

    .score-table {
        font-size: 0.8rem;
    }
}
