/* Eishockey Spielplanung – Backend */

/* Der Verband-Frontend-Bereich ([ehsp_verband]) loest sich bewusst aus der
   (oft schmalen) Inhaltsspalte des WordPress-Themes und nutzt 90% der
   Fensterbreite, zentriert. Die Klasse .ehsp-verband-panel kommt
   ausschliesslich im Frontend-Bereich vor, daher betrifft dies nicht das
   wp-admin-Backend. */
.ehsp-verband-panel {
    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: calc(-45vw) !important;
    margin-right: calc(-45vw) !important;
}

@media (max-width: 900px) {
    .ehsp-verband-panel {
        width: 96vw;
        max-width: 96vw;
        margin-left: calc(-48vw) !important;
        margin-right: calc(-48vw) !important;
    }
}

.ehsp-wrap .ehsp-admin-calendar {
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0 30px;
}

#ehsp-admin-calendar {
    width: 100%;
}

.ehsp-wrap .form-table th {
    width: 220px;
}

.ehsp-wrap .form-table input[type="text"],
.ehsp-wrap .form-table input[type="email"],
.ehsp-wrap .form-table input[type="date"],
.ehsp-wrap .form-table input[type="time"],
.ehsp-wrap .form-table select {
    max-width: 420px;
    width: 100%;
}

.ehsp-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid #bbb;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Gelöschte Termine */
.ehsp-strike,
.ehsp-row-deleted td:not(:last-child) {
    text-decoration: line-through;
}

.ehsp-row-deleted {
    background: #fdf1f1 !important;
    color: #8a5a5a;
}

.ehsp-status-deleted {
    color: #dc323f;
    font-weight: 600;
}

.ehsp-status-active {
    color: #2f8f46;
    font-weight: 600;
}

/* Kalender-Events */
.fc-event {
    cursor: pointer;
}

.fc-event.ehsp-event-deleted,
.fc-event.ehsp-event-deleted .fc-event-title,
.fc-event.ehsp-event-deleted .fc-event-time {
    text-decoration: line-through;
    opacity: 0.7;
}

.fc-event.ehsp-event-deleted {
    border-style: dashed !important;
    border-width: 2px !important;
}

/* Protokoll */
.ehsp-action {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #666;
}

.ehsp-action-create { background: #2f8f46; }
.ehsp-action-update { background: #2271b1; }
.ehsp-action-delete { background: #dc323f; }
.ehsp-action-restore { background: #b26500; }

.ehsp-log-changes {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

.ehsp-log-table {
    margin-top: 12px;
}

.ehsp-log-header p {
    background: #f6f7f7;
    border-left: 4px solid #2271b1;
    padding: 10px 12px;
}

.ehsp-log-row:hover {
    background: #f0f6fc !important;
}

/* Modal */
.ehsp-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 160000;
    padding: 30px 15px;
    overflow: auto;
}

.ehsp-modal-content {
    background: #fff;
    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;
    margin: 20px auto;
    padding: 28px 25px 25px;
    border-radius: 6px;
    position: relative;
}

@media (max-width: 900px) {
    .ehsp-modal-content {
        width: 96vw;
        max-width: 96vw;
    }
}

.ehsp-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.ehsp-pre {
    background: #f6f7f7;
    border: 1px solid #ddd;
    padding: 14px;
    border-radius: 4px;
    max-width: 720px;
    overflow: auto;
}

.ehsp-list {
    list-style: disc;
    margin-left: 22px;
}

/* ---- Eigenständige Benutzerverwaltung im Backend ---- */

.ehsp-usermgr .ehsp-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 25px;
}

.ehsp-usermgr .ehsp-table th,
.ehsp-usermgr .ehsp-table td {
    border: 1px solid #e2e2e2;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.ehsp-usermgr .ehsp-table thead th {
    background: #f6f7f7;
    font-weight: 600;
}

.ehsp-row-inactive {
    background: #f7f7f7;
    color: #777;
}

.ehsp-edit-row > td {
    background: #fafbfc;
}

.ehsp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
    max-width: 1100px;
}

.ehsp-user-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.ehsp-user-form input[type="text"],
.ehsp-user-form input[type="email"],
.ehsp-user-form select {
    width: 100%;
    max-width: 100%;
    padding: 6px 8px;
    box-sizing: border-box;
}

label.ehsp-inline {
    display: block;
    margin-bottom: 6px;
    font-weight: 400;
}

.ehsp-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 18px;
}

.ehsp-btn {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    background: #f6f7f7;
    color: #1d2327;
    cursor: pointer;
    font-size: 13px;
}

.ehsp-btn-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.ehsp-notice {
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 3px;
}

.ehsp-notice-info { background: #f0f6fc; border-left: 4px solid #2271b1; }
.ehsp-notice-error { background: #fdf1f1; border-left: 4px solid #dc323f; }
.ehsp-notice-success { background: #f0f8f1; border-left: 4px solid #2f8f46; }

/* ---- Freie Termine (CSV-Import) ---- */

.fc-event.ehsp-slot-event {
    background: repeating-linear-gradient(135deg, #ffffff, #ffffff 6px, #eaf6ec 6px, #eaf6ec 12px) !important;
    border: 1px dashed #2f8f46 !important;
    color: #1d5c30 !important;
    font-style: italic;
}

.ehsp-slotmgr .form-group {
    margin-bottom: 12px;
}

.ehsp-slotmgr .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.ehsp-slotmgr .form-help {
    display: block;
    margin-top: 5px;
    color: #666;
}

.ehsp-slot-import {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 14px;
    margin-bottom: 20px;
    max-width: 760px;
}

.ehsp-slot-table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 16px;
}

.ehsp-slot-table th,
.ehsp-slot-table td {
    border: 1px solid #e2e2e2;
    padding: 7px 10px;
    text-align: left;
}

.ehsp-slot-table thead th {
    background: #f6f7f7;
    font-weight: 600;
}

.ehsp-inline-form {
    display: inline;
    margin: 0;
}

.ehsp-slot-errors {
    margin: 8px 0 0 18px;
}

.ehsp-button-danger {
    border-color: #dc323f;
    color: #dc323f;
    background: #fff;
}

.ehsp-notice-warning {
    background: #fff8e5;
    border-left: 4px solid #dba617;
}

/* ---- Einstellungen: Planungszeitraum und Spieltage ---- */

.ehsp-settings-form .form-table th {
    width: 220px;
}

.ehsp-weekdays {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 6px;
}

.ehsp-weekday {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}


/* ---- Freie Termine je Halle und Sperrungen ---- */

.fc-event.ehsp-slot-event.ehsp-slot-salzgittersee {
    background: repeating-linear-gradient(135deg, #ffffff, #ffffff 7px, #cdebd3 7px, #cdebd3 14px) !important;
    border: 1px dashed #2f8f46 !important;
    color: #1d5c30 !important;
}

.fc-event.ehsp-slot-event.ehsp-slot-braunlage {
    background: repeating-linear-gradient(135deg, #ffffff, #ffffff 7px, #f8cfcf 7px, #f8cfcf 14px) !important;
    border: 1px dashed #c0392b !important;
    color: #8a1f28 !important;
}

.fc-event.ehsp-slot-event.ehsp-slot-other {
    background: repeating-linear-gradient(135deg, #ffffff, #ffffff 7px, #e6e8ea 7px, #e6e8ea 14px) !important;
    border: 1px dashed #6c7781 !important;
    color: #3c434a !important;
}

.fc-event.ehsp-block-event {
    background: repeating-linear-gradient(135deg, #e9e9e9, #e9e9e9 7px, #cfcfcf 7px, #cfcfcf 14px) !important;
    border: 1px solid #6c7781 !important;
    color: #3c434a !important;
    font-weight: 600;
}

.ehsp-legend-color.ehsp-legend-slot-sz {
    background: repeating-linear-gradient(135deg, #ffffff, #ffffff 4px, #cdebd3 4px, #cdebd3 8px);
    border: 1px dashed #2f8f46;
}

.ehsp-legend-color.ehsp-legend-slot-brl {
    background: repeating-linear-gradient(135deg, #ffffff, #ffffff 4px, #f8cfcf 4px, #f8cfcf 8px);
    border: 1px dashed #c0392b;
}

.ehsp-legend-color.ehsp-legend-block {
    background: repeating-linear-gradient(135deg, #e9e9e9, #e9e9e9 4px, #cfcfcf 4px, #cfcfcf 8px);
    border: 1px solid #6c7781;
}

.ehsp-slot-subhead {
    margin: 26px 0 8px;
    font-size: 17px;
}

.ehsp-block-times {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.ehsp-block-times .form-group {
    margin-bottom: 0;
}

.ehsp-game-import {
    max-width: 900px;
    margin-top: 12px;
}

.ehsp-import-errors {
    margin: 8px 0 0 18px;
}


/* ---- Terminanfragen ---- */

/* Vormerkungen: Hallenfarbe, Streifen gegenläufig zu den freien Zeiten */

.fc-event.ehsp-request-event {
    background: repeating-linear-gradient(45deg, #ffffff, #ffffff 7px, #e6e8ea 7px, #e6e8ea 14px) !important;
    border: 1px dashed #6c7781 !important;
    color: #3c434a !important;
}

.fc-event.ehsp-request-event.ehsp-request-salzgittersee {
    background: repeating-linear-gradient(45deg, #ffffff, #ffffff 7px, #cdebd3 7px, #cdebd3 14px) !important;
    border: 1px dashed #2f8f46 !important;
    color: #1d5c30 !important;
}

.fc-event.ehsp-request-event.ehsp-request-braunlage {
    background: repeating-linear-gradient(45deg, #ffffff, #ffffff 7px, #f8cfcf 7px, #f8cfcf 14px) !important;
    border: 1px dashed #c0392b !important;
    color: #8a1f28 !important;
}

.fc-event.ehsp-request-event.ehsp-request-other {
    background: repeating-linear-gradient(45deg, #ffffff, #ffffff 7px, #e6e8ea 7px, #e6e8ea 14px) !important;
    border: 1px dashed #6c7781 !important;
    color: #3c434a !important;
}

.ehsp-legend-color.ehsp-legend-request {
    background: repeating-linear-gradient(45deg, #ffffff, #ffffff 4px, #e6e8ea 4px, #e6e8ea 8px);
    border: 1px dashed #6c7781;
}

/* Spieltermine: Hintergrund nach Austragungsstätte */

.fc-event.ehsp-game-salzgittersee { color: #1d5c30 !important; }
.fc-event.ehsp-game-braunlage { color: #8a1f28 !important; }
.fc-event.ehsp-game-other { color: #3c434a !important; }

.ehsp-request-form .ehsp-request-slot {
    padding: 10px 12px;
    background: #f2f6fa;
    border-left: 4px solid #2f5f8f;
    margin-bottom: 14px;
}

.ehsp-request-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.ehsp-request-form input[type="text"],
.ehsp-request-form input[type="email"],
.ehsp-request-form select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.ehsp-request-form .ehsp-hint {
    font-size: 13px;
    color: #50575e;
}

.ehsp-request-message:empty {
    display: none;
}

/* Anfragen ohne E-Mail-Bestätigung */

.fc-event.ehsp-request-event.ehsp-request-unconfirmed {
    border-style: dotted !important;
    opacity: 0.85;
}

/* ---- Schnelleintrag aus dem Kalender ---- */

.ehsp-quick-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.ehsp-quick-form input[type="text"],
.ehsp-quick-form input[type="time"],
.ehsp-quick-form select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-weight: 400;
}

.ehsp-quick-form p {
    margin: 0 0 12px;
}

.ehsp-quick-message.success { color: #1f7a3d; }
.ehsp-quick-message.error { color: #b32d2e; }
.ehsp-quick-message:empty { display: none; }

/* ---- Vereinsauswahl und offene Spiele ---- */

.ehsp-team-manual {
    margin-top: 6px;
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.ehsp-open-games {
    margin: 24px 0;
    padding: 16px 18px;
    background: #f4f8fb;
    border: 1px solid #cfdce8;
    border-radius: 6px;
}

.ehsp-open-games h3 {
    margin-top: 0;
}

.ehsp-open-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.ehsp-open-table th,
.ehsp-open-table td {
    border: 1px solid #d3dde6;
    padding: 6px 9px;
    font-size: 14px;
    text-align: left;
    background: #ffffff;
}

.ehsp-open-table th {
    background: #e8f0f7;
}

.ehsp-open-table tr.ehsp-open-done td {
    color: #1f7a3d;
}

.ehsp-open-table tr.ehsp-open-pending td:last-child {
    color: #b32d2e;
    font-weight: 600;
}

/* Begründung bei Ablehnung von Anfragen */
.ehsp-reason-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #50575e;
}

.ehsp-reason-label textarea {
    width: 100%;
    max-width: 320px;
    font-size: 12px;
}

/* Schraffierter Button für Vormerkungen */
.button.ehsp-btn-hatched {
    background-color: #f3f4f5;
    background-image: repeating-linear-gradient(135deg, #c4c8cc 0 5px, #e3e5e7 5px 10px);
    border: 1px dashed #6c7781;
    color: #1d2327;
    font-weight: 600;
}

.button.ehsp-btn-hatched:hover {
    background-color: #e8eaec;
    border-color: #1d2327;
    color: #1d2327;
}

/* Vorgemerkte Termine in Backend-Tabellen grau schraffiert */
tr.ehsp-hatched td {
    background-image: repeating-linear-gradient(135deg, #c4c8cc 0 5px, #e3e5e7 5px 10px) !important;
    color: #3c434a;
}

/* Bearbeitungsfeld für vorgemerkte Anfragen */
.ehsp-request-edit {
    margin: 8px 0;
    padding: 8px 10px;
    border: 1px dashed #6c7781;
    background: #fbfbfc;
    max-width: 320px;
}

.ehsp-request-edit p {
    margin: 6px 0;
}

/* Bearbeiten in der Liste „Alle Spiele“ */
tr.ehsp-game-edit-row > td {
    background: #f6f7f7;
    border-left: 4px solid #2271b1;
}

.ehsp-edit-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 6px;
}

.ehsp-edit-grid label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 12px;
}

.ehsp-edit-grid input,
.ehsp-edit-grid select {
    font-weight: 400;
    margin-top: 3px;
}

/* Filterhinweis auf der Seite „Terminanfragen“ */
.ehsp-request-filter {
    margin: 12px 0 16px;
    padding: 8px 12px;
    background: #f6f7f7;
    border-left: 4px solid #2271b1;
}

.ehsp-request-filter .button {
    margin-left: 8px;
}

/* Auf-/zuklappbare Abschnitte (z. B. CSV-Import/Export, Neuen Verein anlegen) */
.ehsp-collapsible-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ehsp-collapsible-toggle:hover {
    color: #2271b1;
}

.ehsp-collapsible-arrow {
    display: inline-block;
    font-size: 0.7em;
    transition: transform 0.15s ease;
}

.ehsp-collapsible-toggle.ehsp-collapsible-open .ehsp-collapsible-arrow {
    transform: rotate(90deg);
}

.ehsp-collapsible-content {
    margin-bottom: 10px;
}
