body {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

h1 {
    text-align: center;
    color: #007bff;
    margin-bottom: 30px;
    font-weight: 700;
}

.controls {
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#event-name {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    flex-grow: 1;
    max-width: 300px;
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #0056b3;
}

table {
    width: 100%;
    border-collapse: separate; /* border-spacingのために必要 */
    border-spacing: 0;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden; /* 角丸を適用するため */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

th, td {
    border: 1px solid #dee2e6;
    padding: 12px 15px;
    text-align: center;
    vertical-align: middle;
}

thead th {
    background-color: #e9ecef;
    font-weight: 700;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

tbody tr:hover {
    background-color: #e2e6ea;
}

.score-input,
.remarks-input {
    width: calc(100% - 20px); /* パディングを考慮 */
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 5px;
}

.delete-event-btn,
.delete-score-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
    margin-left: 5px;
}

.delete-event-btn:hover,
.delete-score-btn:hover {
    background-color: #c82333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }

    #event-name {
        max-width: 100%;
    }

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

    .score-input,
    .remarks-input {
        width: 100%;
    }
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 120px; /* 幅を調整 */
    height: 34px;
    margin: 0 10px;
}

.toggle-switch-checkbox {
    display: none;
}

.toggle-switch-label {
    display: block;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #007bff;
    border-radius: 20px;
}

.toggle-switch-inner {
    display: block;
    width: 200%;
    margin-left: -100%;
    transition: margin 0.3s ease-in 0s;
}

.toggle-switch-inner:before, .toggle-switch-inner:after {
    display: block;
    float: left;
    width: 50%;
    height: 30px;
    padding: 0;
    line-height: 30px;
    font-size: 14px;
    color: white;
    font-weight: bold;
    box-sizing: border-box;
}

.toggle-switch-inner:before {
    content: "ランキング順";
    padding-left: 10px;
    background-color: #007bff;
    color: #FFFFFF;
}

.toggle-switch-inner:after {
    content: "チーム順";
    padding-right: 10px;
    background-color: #ced4da;
    color: #555555;
    text-align: right;
}

.toggle-switch-switch {
    display: block;
    width: 24px;
    margin: 5px;
    background: #FFFFFF;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 82px; /* 幅に合わせて調整 */
    border: 2px solid #007bff;
    border-radius: 20px;
    transition: all 0.3s ease-in 0s;
}

.toggle-switch-checkbox:checked + .toggle-switch-label .toggle-switch-inner {
    margin-left: 0;
}

.toggle-switch-checkbox:checked + .toggle-switch-label .toggle-switch-switch {
    right: 0px;
}

.toggle-switch-text {
    margin-left: 10px;
    line-height: 34px;
    font-size: 1rem;
    color: #343a40;
}

.reset-event-score-btn {
    background-color: #ffc107; /* 黄色系 */
    color: #212529; /* 濃い色 */
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
    margin-left: 5px;
}

.reset-event-score-btn:hover {
    background-color: #e0a800; /* ホバー時の色 */
}
