/* Youth Soccer Manager Public Styles */

select, #ysm-start-date, #ysm-end-date,
.ysm-date-filter-item > input {
    font-size: 16px;
    color: rgb(77, 76, 76);
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #ddd;
}

.ysm-date-filter {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    gap: 0.5rem;
}

.ysm-match-result {
    font-size: 0.8rem;
    color: #666;
}

.ysm-match-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed;
}

.ysm-match-list th,
.ysm-match-list td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    width: 20%;
}

.ysm-match-list th:nth-child(3),
.ysm-match-list td:nth-child(3) {
    width: 40%;
}

.ysm-match-list th {
    background-color: #f2f2f2;
}

/* Spaltenbreiten für eingeloggte und ausgeloggte Benutzer */
.ysm-match-list td[data-label="Datum"],
.ysm-match-list td[data-label="Uhrzeit"] {
    width: 15%;
}

.ysm-match-list td[data-label="Spiel"] {
    width: 40%;
}

.ysm-match-list td[data-label="Verfügbar"],
.ysm-match-list td[data-label="Ort"] {
    width: 15%;
}

.ysm-match-list td[data-label="Aktionen"] {
    width: 15%;
}

.ysm-toggle-availability,
.ysm-availability-button {
    background-color: transparent;
    border: none;
    color: white;
    padding: 5px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 4px 2px;
    cursor: pointer;
}

.ysm-toggle-availability img,
.ysm-copy-match-info img {
    width: 16px;
    height: 16px;
}

.ysm-copy-match-info {
    background-color: transparent;
    border: none;
    color: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    cursor: pointer; /* Fügt den Mauszeiger beim Hovern hinzu */
    padding: 5px; /* Fügt etwas Padding hinzu, um den Klickbereich zu vergrößern */
}

.ysm-popup {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.ysm-popup-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
}

.ysm-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0 20 ;
}

.ysm-popup-header h2 {
    margin: 0;
}

.ysm-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.ysm-popup-close:hover,
.ysm-popup-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#ysm-availability-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Table Styles */
.ysm-availability-table {
    width: 100%;
    border-collapse: collapse;
}

.ysm-availability-table th,
.ysm-availability-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    width: 25%;
}

.ysm-availability-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.ysm-availability-table td img.player-photo {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.ysm-availability-table td .player-photo-placeholder {
    width: 50px;
    height: 50px;
    background-color: #ccc;
}

.ysm-availability-table td select {
    width: 100%;
}

.ysm-availability-table td label.lock-checkbox {
    display: block;
}

.ysm-availability-table td .locked-elsewhere-message,
.ysm-availability-table td .lock-origin-message {
    display: block;
    color: red;
    font-weight: bold;
}

#ysm-player-availability-form div {
    margin-bottom: 10px;
}

#ysm-player-availability-form label {
    display: inline-block;
    width: 150px;
}

#ysm-player-availability-form button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

#ysm-player-availability-form button:hover {
    background-color: #45a049;
}

/* Responsive styles */
@media screen and (max-width: 600px) {
    .ysm-match-list,
    .ysm-match-list tbody,
    .ysm-match-list tr,
    .ysm-match-list td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .ysm-match-list thead {
        display: none;
    }
    
    .ysm-match-list tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        background-color: #f9f9f9;
    }
    
    .ysm-match-list td {
        display: block;
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 10px;
        text-align: left;
        width: 100% !important; /* Überschreiben Sie alle vorherigen Breiteneinstellungen */
    }
    
    .ysm-match-list td:last-child {
        border-bottom: none;
    }
    
    .ysm-match-list td:before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .ysm-match-list td[data-label="Spiel"] {
        padding: 10px;
    }

    .ysm-match-list td[data-label="Aktionen"] {
        text-align: left;
    }

    .ysm-toggle-availability,
    .ysm-copy-match-info {
        display: inline-block;
        margin: 5px 5px 5px 0;
    }

    .ysm-availability-details {
        margin-top: 0;
        margin-bottom: 15px;
        padding: 10px;
    }

    .ysm-match-list td[data-label="Verfügbar"] .ysm-available-count {
        display: inline-block;
    }
}

/* Zusätzliche Anpassungen für sehr kleine Bildschirme */
@media screen and (max-width: 400px) {
    .ysm-match-list td {
        font-size: 14px;
    }
}

/* Bestehende Styles beibehalten */

/* Stil für das Mehrfachauswahlfeld in der Spieler-Bearbeitungsseite */
#ysm_player_assigned_teams {
    width: 100%;
    min-height: 100px;
}

.ysm-match-list td[data-label="Spiel"] small {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

.player-availability-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.player-photo,
.player-photo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.player-photo-placeholder {
    background-color: #e0e0e0;
}

#ysm-player-availability-form label {
    flex: 1;
    margin-right: 10px;
}

#ysm-player-availability-form select {
    width: 160px;
}

#ysm-availability-form {
    max-height: 400px;
    overflow-y: auto;
}

.player-availability-row.locked-elsewhere {
    opacity: 0.5;
}

.locked-elsewhere-message {
    color: red;
    font-style: italic;
    margin-left: 10px;
}

/* Flexbox Styles */
.ysm-availability-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-availability-row {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.player-photo-container {
    flex: 0 0 50px;
    margin-right: 10px;
}

.player-photo,
.player-photo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.player-photo-placeholder {
    background-color: #ccc;
}

.player-info-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.player-info-container label.player-name {
    font-weight: bold;
}

.player-info-container select {
    width: 100%;
}

.lock-checkbox {
    display: block;
}

.locked-elsewhere-message,
.lock-origin-message {
    color: red;
    font-weight: bold;
}

/* Responsive styles */
@media screen and (max-width: 600px) {
    .player-availability-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .player-photo-container {
        margin-bottom: 10px;
    }

    .player-info-container {
        width: 100%;
    }
}

/* Bestehende Styles beibehalten */

/* Neue Styles für bessere visuelle Gruppierung */
.ysm-match-overview {
    border: 1px solid #ddd;
    margin-bottom: 0.5rem;
}

.ysm-availability-details {
    border: 1px solid #ddd;
    border-top: none;
    background-color: #f9f9f9;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.1);
}

/* Stil für den aktiven Zustand des Toggle-Buttons */
.ysm-toggle-availability.active {
    background-color: #f0f0f0;
    border-bottom: 2px solid #4CAF50;
}

/* Verbesserte Sichtbarkeit für den ausgeklappten Bereich */
.ysm-availability-details {
    display: none;
}

.ysm-availability-details.visible {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Responsives Design verbessern */
@media screen and (max-width: 600px) {
    .ysm-match-overview,
    .ysm-availability-details {
        border: none;
        box-shadow: none;
    }

    .ysm-match-overview {
        margin-bottom: 10px;
    }

    .ysm-availability-details {
        background-color: #fff;
        padding: 0 10px 10px;
    }
}

.ysm-copy-player-list {
    position: static; /* Entfernen der absoluten Positionierung */
    width: 20px;
    height: 20px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.ysm-copy-player-list img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Stellen Sie sicher, dass der Popup-Container eine relative Positionierung hat */
.ysm-popup-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
}

.ysm-match-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ysm-copy-full-schedule {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.ysm-copy-full-schedule img {
    width: 24px;
    height: 24px;
}

.ysm-availability-overview {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

#ysm-show-availability-details {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

#ysm-show-availability-details img {
    width: 16px;
    height: 16px;
}


/* Anpassungen für den Button im Popup */
#ysm-player-availability-form button[type="submit"] {
    display: block;
    margin: 20px auto 0;
    background-color: transparent;
    color: #494949;
    border: 2px solid #494949;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

#ysm-player-availability-form button[type="submit"]:hover {
    background-color: #494949;
    color: white;
}

/* Zentrieren des Formulars im Popup */
#ysm-availability-form {
    text-align: center;
}

/* Anpassung der Breite des Formulars, um es besser zu zentrieren */
#ysm-player-availability-form {
    max-width: 80%;
    margin: 0 auto;
}

.ysm-generate-image {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.ysm-generate-image img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.ysm-past-match {
    background-color: #f0f0f0; /* Leichter Grauton */
    opacity: 0.8; /* Leichte Transparenz für zusätzlichen visuellen Effekt */
}

.ysm-past-match td {
    color: #666; /* Dunklere Textfarbe für besseren Kontrast */
}

/* Neuer Stil für den Spielstatus */
.ysm-match-status {
    font-style: italic;
    font-size: 0.8em;
    color: #888;
    display: block;
    margin-top: 2px;
}

/* Anpassung für die mobile Ansicht */
@media screen and (max-width: 600px) {
    .ysm-match-list td[data-label="Datum"] .ysm-match-status {
        display: inline;
        margin-left: 5px;
    }
}