﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #34495e;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    padding: 25px;
    overflow-x: auto;
    border: 1px solid #4a6572;
}

h1 {
    text-align: center;
    margin-bottom: 25px;
    color: #3498db;
    font-size: 2.2em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 12px;
}

button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

    button:hover {
        background: linear-gradient(135deg, #2980b9, #2573a7);
        transform: translateY(-2px);
        box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    }

#add-player {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

    #add-player:hover {
        background: linear-gradient(135deg, #d35400, #c0392b);
    }

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    background-color: #2c3e50;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

th, td {
    border: 1px solid #4a6572;
    padding: 14px;
    text-align: center;
    transition: background-color 0.2s ease;
}

th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    position: sticky;
    top: 0;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.player-header {
    min-width: 160px;
    position: relative;
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
}

.player-name {
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: white;
    font-weight: bold;
    text-align: center;
    outline: none;
    font-size: 1em;
}

    .player-name::placeholder {
        color: rgba(255, 255, 255, 0.8);
    }

    .player-name:focus {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }

.remove-player {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .remove-player:hover {
        background: #e74c3c;
        transform: scale(1.1);
    }

.row-header {
    text-align: left;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    font-weight: 600;
    width: 220px;
    color: #ecf0f1;
    border-right: 2px solid #e67e22;
}

input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #4a6572;
    border-radius: 6px;
    text-align: center;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 1em;
    transition: all 0.3s ease;
}

    input[type="number"]:focus {
        outline: none;
        border-color: #3498db;
        background-color: #34495e;
        box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
    }

    input[type="number"]:hover {
        border-color: #5dade2;
    }

.totals-row {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    font-weight: bold;
}

    .totals-row td {
        font-size: 1.2em;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    .totals-row .row-header {
        background: linear-gradient(135deg, #e67e22, #d35400);
        border-right: 2px solid #3498db;
        color: white;
    }

.footer {
    text-align: center;
    margin-top: 25px;
    color: #bdc3c7;
    font-size: 0.9em;
    padding-top: 15px;
    border-top: 1px solid #4a6572;
}

/* Add some visual enhancements */
tr:hover td:not(.row-header) {
    background-color: rgba(52, 152, 219, 0.1);
}

tr:hover .row-header {
    background: linear-gradient(135deg, #3c6382, #34495e);
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    th, td {
        padding: 10px 6px;
    }

    .player-header {
        min-width: 130px;
    }

    .row-header {
        width: 150px;
        font-size: 0.9em;
    }

    .controls {
        justify-content: center;
    }

    button {
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

/* Animation for new player columns */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.player-header:last-child {
    animation: slideIn 0.3s ease-out;
}

/* Tips Section */
.tips-section {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #4a6572;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

    .tips-header h2 {
        color: #3498db;
        margin: 0;
        font-size: 1.4em;
    }

.tips-toggle {
    background: linear-gradient(135deg, #e67e22, #d35400);
    padding: 8px 16px;
    font-size: 0.9em;
}

.tips-content {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

    .tips-content.show {
        display: grid;
        animation: fadeIn 0.3s ease-out;
    }

.tip-category {
    background: rgba(52, 152, 219, 0.1);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #e67e22;
}

    .tip-category h3 {
        color: #e67e22;
        margin-bottom: 10px;
        font-size: 1.1em;
    }

    .tip-category ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .tip-category li {
        padding: 5px 0;
        padding-left: 20px;
        position: relative;
        color: #bdc3c7;
        line-height: 1.4;
    }

        .tip-category li:before {
            content: "•";
            color: #3498db;
            position: absolute;
            left: 8px;
        }

/* Quick Reference Section */
.reference-section {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #4a6572;
}

    .reference-section h3 {
        color: #3498db;
        margin-bottom: 15px;
        text-align: center;
    }

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.reference-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    color: #ecf0f1;
}

.ref-icon {
    font-size: 1.2em;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tips-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .tips-content {
        grid-template-columns: 1fr;
    }

    .reference-grid {
        grid-template-columns: 1fr;
    }

    .controls {
        justify-content: center;
    }
}

/* Graph Section */
.graph-section {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
    border: 1px solid #4a6572;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

    .graph-header h2 {
        color: #3498db;
        margin: 0;
        font-size: 1.4em;
    }

.graph-toggle {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    padding: 8px 16px;
    font-size: 0.9em;
}

.graph-container {
    display: none;
    text-align: center;
}

    .graph-container.show {
        display: block;
        animation: fadeIn 0.5s ease-out;
    }

#score-chart {
    background: #2c3e50;
    border-radius: 8px;
    border: 1px solid #4a6572;
    max-width: 100%;
    margin-bottom: 15px;
}

.graph-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    color: #ecf0f1;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Responsive graph */
@media (max-width: 768px) {
    .graph-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    #score-chart {
        height: 300px;
    }

    .graph-legend {
        flex-direction: column;
        align-items: center;
    }
}

/* Enhanced Tips Section */
.tips-content.show {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    animation: fadeIn 0.3s ease-out;
}

.tip-category {
    background: rgba(52, 152, 219, 0.1);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #e67e22;
    position: relative;
    transition: transform 0.2s ease;
}

    .tip-category:hover {
        transform: translateY(-2px);
    }

    .tip-category h3 {
        color: #e67e22;
        margin-bottom: 15px;
        font-size: 1.2em;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .tip-category ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .tip-category li {
        padding: 8px 0;
        padding-left: 24px;
        position: relative;
        color: #bdc3c7;
        line-height: 1.5;
        border-bottom: 1px solid rgba(52, 152, 219, 0.2);
    }

        .tip-category li:last-child {
            border-bottom: none;
        }

        .tip-category li:before {
            content: "💡";
            position: absolute;
            left: 5px;
            font-size: 0.9em;
        }

        .tip-category li strong {
            color: #3498db;
            font-weight: 600;
        }

    /* Specific category colors */
    .tip-category:nth-child(1) {
        border-left-color: #2ecc71; /* Green for beginners */
    }

        .tip-category:nth-child(1) h3 {
            color: #2ecc71;
        }

    .tip-category:nth-child(2) {
        border-left-color: #e74c3c; /* Red for advanced */
    }

        .tip-category:nth-child(2) h3 {
            color: #e74c3c;
        }

    .tip-category:nth-child(3) {
        border-left-color: #f39c12; /* Orange for openings */
    }

        .tip-category:nth-child(3) h3 {
            color: #f39c12;
        }

/* Responsive adjustments */
@media (max-width: 968px) {
    .tips-content.show {
        grid-template-columns: 1fr;
    }

    .tip-category {
        padding: 15px;
    }
}