/* ── Todo Event Modal (Kalender-Klick) ──────────────────────────────────── */
/* Nutzt CSS-Variablen aus todo.css / Basis-Kalender */
/* ── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
    --todo-surface:      #fff;
    --todo-border:       #e2e8f0;
    --todo-radius-lg:    8px;
    --todo-shadow:       0 1px 4px rgba(0,0,0,.07);
    --todo-transition:   .15s ease;
    --todo-text-muted:   #6b7280;

    /* Priority colours */
    --todo-prio-new:     #3b82f6;
    --todo-prio-high:    #ef4444;
    --todo-prio-normal:  #f59e0b;
    --todo-prio-low:     #10b981;
    --todo-prio-done:    #C9CDD4;
}


/* Priority badge */
.ter-kal-prio-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.prio-badge-new    { background: #dbeafe; color: #1d4ed8; }
.prio-badge-high   { background: #fee2e2; color: #b91c1c; }
.prio-badge-normal { background: #fef3c7; color: #92400e; }
.prio-badge-low    { background: #d1fae5; color: #065f46; }
.prio-badge-done   { background: #f3f4f6; color: #6b7280; }

#ter-kal-todo-event-modal {
    position: fixed;
    inset: 0;
    z-index: 100100; /* über WP admin bar (9999) und FullCalendar */
    display: flex;
    align-items: center;
    justify-content: center;
}

#ter-kal-todo-event-modal[hidden] {
    display: none;
}

/* Backdrop */
.ter-kal-tem-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    cursor: pointer;
}

/* Dialog */
.ter-kal-tem-dialog {
    position: relative;
    background: var(--todo-surface, #fff);
    border-radius: var(--todo-radius-lg, 8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
    width: min(480px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Header */
.ter-kal-tem-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--todo-border, #e2e8f0);
    gap: 8px;
}

.ter-kal-tem-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.ter-kal-tem-title .dashicons {
    color: var(--todo-prio-new, #3b82f6);
}

.ter-kal-tem-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--todo-text-muted, #6b7280);
    line-height: 1;
    transition: color var(--todo-transition, .15s ease);
}

.ter-kal-tem-close:hover {
    color: #111;
}

/* Body */
.ter-kal-tem-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Prio bar am oberen Rand des Dialogs */
.ter-kal-tem-prio-stripe {
    height: 4px;
    border-radius: var(--todo-radius-lg, 8px) var(--todo-radius-lg, 8px) 0 0;
    width: 100%;
}

/* Felder — selbe Klassen wie todo.css */
.ter-kal-tem-body .ter-kal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ter-kal-tem-body .ter-kal-field-row {
    display: flex;
    gap: 12px;
}

.ter-kal-tem-body .ter-kal-field-row .ter-kal-field {
    flex: 1;
}

/* Footer */
.ter-kal-tem-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--todo-border, #e2e8f0);
}

/* Status-Zeile im Modal */
.ter-kal-tem-status {
    font-size: .8rem;
    padding: 0 20px 8px;
    min-height: 1.2em;
}

.ter-kal-tem-status.is-error  { color: #dc2626; }
.ter-kal-tem-status.is-success { color: #16a34a; }
.ter-kal-tem-status.is-info    { color: var(--todo-text-muted, #6b7280); }

/* View-Mode: read-only Felder */
.ter-kal-tem-view-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ter-kal-tem-view-label {
    font-size: .75rem;
    color: var(--todo-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ter-kal-tem-view-value {
    font-size: .95rem;
}

/* ── To-Do Marker im FullCalendar ───────────────────────────────────────── */


/*.ter-kal-is-todo .time_text {
    font-size: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
}*/

.ter-kal-is-todo span.time_text {
    font-size: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 0;
    /*background: rgba(0, 0, 0, 0.15);*/
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
}

.ter-kal-is-todo span.time_text::before {
    content: "\f147";
    font-family: dashicons;
    font-size: 16px;
    margin-right: 3px;
}


.ter-kal-is-todo span.time_text::after {
    content: "To-Do";
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── To-Do Prioritätsfarben erzwingen (Schutz vor JS-Überschreiben) ─────── */

/* 1. Gemeinsame Text-Styles für alle To-Do Events */
.fc-event.ter-kal-is-todo:not(.fc-list-event) .title_text {
    background-color: transparent !important; /* Verhindert doppelte Hintergründe */
    color: var(--todo-surface, #fff) !important;
}

/* 2. Prio-spezifische Hintergründe aus den CSS-Variablen */

/* Prio: Neu */
.fc-event.ter-kal-is-todo.ter-kal-prio-new:not(.fc-list-event) {
    background-color: var(--todo-prio-new) !important;
    border-color: var(--todo-prio-new) !important;
}

/* Prio: Hoch */
.fc-event.ter-kal-is-todo.ter-kal-prio-high:not(.fc-list-event) {
    background-color: var(--todo-prio-high) !important;
    border-color: var(--todo-prio-high) !important;
}

/* Prio: Normal */
.fc-event.ter-kal-is-todo.ter-kal-prio-normal:not(.fc-list-event) {
    background-color: var(--todo-prio-normal) !important;
    border-color: var(--todo-prio-normal) !important;
}

/* Prio: Niedrig */
.fc-event.ter-kal-is-todo.ter-kal-prio-low:not(.fc-list-event) {
    background-color: var(--todo-prio-low) !important;
    border-color: var(--todo-prio-low) !important;
}

/* Prio: Erledigt */
.fc-event.ter-kal-is-todo.ter-kal-prio-done {
     display: none !important;
/*    background-color: var(--todo-prio-done) !important;
    border-color: var(--todo-prio-done) !important;*/
}