/* ==========================================================================
   STUDIO GANTT – Gestaltung der Komponente, Basis: Version 0.5.1
   ==========================================================================

   Datei auf dem Webserver:
   /media/com_studiogantt/css/gantt.css

   Diese Fassung ist nur formatiert und deutsch kommentiert.
   Alle Selektoren, Werte und die Reihenfolge der Regeln bleiben erhalten.

   Orientierung:
   #gantt-app ist der äußere Rahmen der gesamten Komponente.
   Darunter stehen die Klassen für Kopf, Werkzeuge, Diagramm und Dialoge.
   Farben mit acht Hex-Ziffern enthalten am Ende einen Transparenzwert.

   Wichtige Besonderheiten:
   - Aufgabenfarben werden in gantt.js als Inline-Stil gesetzt (Objekt colors).
   - Balkenpositionen, Balkenbreiten und variable Zeilenhöhen berechnet JavaScript.
   - Die automatische Höhe verwendet --gantt-viewport-height, das JavaScript setzt.
   - Spätere Regeln ergänzen oder überschreiben frühere Regeln. Deshalb wurden
     gleichnamige Selektoren nicht zusammengelegt oder umgeordnet.
   - Bei einem Komponentenupdate wird diese Datei ersetzt. Dauerhafte zusätzliche
     Frontend-Regeln können im Custom-CSS des Joomla-Templates stehen.

   Eine eigene feste Gesamthöhe kann als letzte Regel ergänzt werden:
   #gantt-app { height: 700px; }
   Für Außenabstände beispielsweise: margin: 20px auto 0;
   Die verfügbare Breite wird auch vom übergeordneten Joomla-Container bestimmt.
   ========================================================================== */

/* ==========================================================================
   1. Grundfarben, Schrift und äußerer Rahmen
   ========================================================================== */

#gantt-app {
    --ink: #26332f; /* Haupttextfarbe */
    --muted: #78857f; /* Farbe für Nebeninformationen */
    --line: #e8ede9; /* Trennlinien und Rahmen */
    --side: 290px; /* Breite der linken Aufgabenliste */
    --row: 56px; /* Basis-Zeilenhöhe; dynamische Zeilen setzt JavaScript separat */
    color: var(--ink);
    font: 14px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    background: #f4f6f3;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 24px);
    min-height: 450px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    width: 94%;
    max-width: none;
    margin-left: auto;
    margin-right: 0;
}

#gantt-app * {
    box-sizing: border-box;
}

#gantt-app button,
#gantt-app input,
#gantt-app select,
#gantt-app textarea {
    font: inherit;
}

#gantt-app button {
    cursor: pointer;
}

#gantt-app button:focus-visible {
    outline: 3px solid #709c89;
    outline-offset: 2px;
}

/* ==========================================================================
   2. Kopfbereich und Projektüberschrift
   ========================================================================== */

#gantt-app .top {
    padding: 22px 26px 14px;
    background: white;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

#gantt-app .eyebrow {
    color: #798b7f;
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 700;
}

#gantt-app h1 {
    font-size: 23px;
    letter-spacing: -.6px;
    margin: 5px 0 4px;
    font-weight: 650;
}

#gantt-app .subtitle {
    font-size: 12px;
    color: var(--muted);
}

#gantt-app .badge {
    font-size: 11px;
    border: 1px solid #dfe8df;
    background: #f5f8f4;
    border-radius: 20px;
    padding: 7px 12px;
}

/* ==========================================================================
   3. Werkzeugleiste, Schaltflächen und Zoom
   ========================================================================== */

#gantt-app .tools {
    background: white;
    padding: 12px 26px 18px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
}

#gantt-app .btn,
#gantt-app select {
    border: 1px solid #dce4dc;
    border-radius: 7px;
    background: white;
    color: var(--ink);
    padding: 8px 12px;
}

#gantt-app .primary {
    background: #345e4c;
    color: white;
    border-color: #345e4c;
}

#gantt-app .danger {
    color: #a13f3f;
}

#gantt-app .tools label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--muted);
}

#gantt-app .tools input[type=range] {
    width: 110px;
    accent-color: #345e4c;
}

#gantt-app .spacer {
    flex: 1;
}

/* ==========================================================================
   4. Diagrammfläche, Zeitachse und fixierte Aufgabenliste
   ========================================================================== */

#gantt-app .board {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: white;
    position: relative;
}

/* Die tatsächliche Gesamtbreite setzt JavaScript passend zum Zoom. */
#gantt-app .sheet {
    min-width: 100%;
    position: relative;
}

#gantt-app .heading,
#gantt-app .row {
    display: flex;
    width: 100%;
}

/* Die Zeitachse bleibt beim vertikalen Scrollen oben stehen. */
#gantt-app .heading {
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 8;
    background: white;
}

/* Die Aufgabenliste bleibt beim horizontalen Scrollen links stehen. */
#gantt-app .left {
    width: var(--side);
    flex: none;
    position: sticky;
    left: 0;
    background: white;
    border-right: 1px solid var(--line);
    z-index: 4;
    padding: 0 20px;
    display: flex;
    align-items: center;
    min-width: 0;
}

#gantt-app .heading .left {
    z-index: 10;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    justify-content: space-between;
}

#gantt-app .axis {
    position: relative;
    flex: none;
    height: 80px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

#gantt-app .tick {
    position: absolute;
    overflow: hidden;
    white-space: nowrap;
    border-right: 1px solid var(--line);
    padding: 11px 8px;
    font-size: 11px;
    height: 40px;
}

#gantt-app .tick.minor {
    top: 40px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    padding: 12px 2px;
}

/* ==========================================================================
   5. Aufgabenzeilen und Leistungsphasen
   ========================================================================== */

#gantt-app .row {
    height: var(--row);
    border-bottom: 1px solid var(--line);
}

#gantt-app .row .left {
    border-bottom: 1px solid var(--line);
}

#gantt-app .row.group .left,
#gantt-app .row.group .track {
    background: #f5f7f4;
}

#gantt-app .row.group .left {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#gantt-app .name {
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    text-align: left;
    color: var(--ink);
    overflow: hidden;
}

#gantt-app .name strong {
    display: block;
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#gantt-app .name small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
}

/* Zeitbereich einer Zeile; Balken werden darin absolut positioniert. */
#gantt-app .track {
    position: relative;
    flex: none;
    isolation: isolate;
    overflow: hidden;
}

/* ==========================================================================
   6. Aufgabenbalken und Meilensteine
   ========================================================================== */

/* Form und Schrift der Balken. Ihre Hintergrundfarbe kommt aus JavaScript. */
#gantt-app .bar {
    position: absolute;
    top: 15px;
    height: 26px;
    border: 0;
    border-radius: 6px;
    color: white;
    padding: 0 10px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 4px #26332f15;
    text-align: left;
    max-width: 100%;
}

#gantt-app .bar:hover {
    filter: brightness(1.07);
}

/* Klickfläche einer Raute. Die sichtbare Raute steht in ::before. */
#gantt-app .diamond {
    position: absolute;
    top: 15px;
    width: 28px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    z-index: 3;
}

/* Farbe, Größe und Rundung der sichtbaren Meilensteinraute. */
#gantt-app .diamond:before {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    background: #345e4c;
    transform: rotate(45deg);
    margin: auto;
    border-radius: 2px;
}

#gantt-app .milestone-label {
    position: absolute;
    top: 19px;
    font-size: 11px;
    color: #53665a;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

/* ==========================================================================
   7. Zeitgitter, Wochenenden, Feiertage und Heute-Linie
   ========================================================================== */

#gantt-app .column {
    position: absolute;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

#gantt-app .weekend {
    background: #f0f3f080;
}

/* Transparente Feiertagsmarkierung hinter den Aufgabenbalken. */
#gantt-app .holiday {
    background: #efcf7845;
}

#gantt-app .grid {
    border-left: 1px solid #e8ede9;
}

/* Senkrechte Linie für den heutigen Tag. */
#gantt-app .today {
    border-left: 2px solid #c56d5d;
    z-index: 3;
}

/* Legende und Anzahl der Einträge unter dem Diagramm. */
#gantt-app .foot {
    padding: 12px 26px;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

#gantt-app .legend {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #efcf7899;
    margin-right: 5px;
    border-radius: 2px;
}

#gantt-app .message {
    color: #ae4236;
    font-size: 12px;
    padding: 0 26px;
    background: white;
}

/* ==========================================================================
   8. Detail- und Bearbeitungsdialoge
   ========================================================================== */

#gantt-app dialog {
    border: 0;
    border-radius: 14px;
    padding: 26px;
    width: 510px;
    max-width: calc(100vw - 30px);
    max-height: 90dvh;
    overflow: auto;
    color: var(--ink);
    box-shadow: 0 20px 70px #17251c40;
}

/* Abgedunkelter Hintergrund bei geöffnetem Dialog. */
#gantt-app dialog::backdrop {
    background: #182d2540;
}

#gantt-app dialog h2 {
    margin: 8px 0 20px;
    font-size: 23px;
}

#gantt-app dialog p {
    white-space: pre-wrap;
    line-height: 1.7;
    color: #64736a;
}

#gantt-app .fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

#gantt-app .fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

#gantt-app .fields .wide {
    grid-column: 1/-1;
}

#gantt-app .fields input,
#gantt-app .fields textarea,
#gantt-app .fields select {
    width: 100%;
    padding: 10px;
    border: 1px solid #dce4dc;
    border-radius: 6px;
    background: white;
    color: var(--ink);
}

#gantt-app .fields textarea {
    min-height: 90px;
    resize: vertical;
}

#gantt-app .actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

#gantt-app dl {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    font-size: 13px;
}

#gantt-app dt {
    color: var(--muted);
}

#gantt-app dd {
    margin: 0;
}

/* Verborgene Bedienelemente bleiben tatsächlich ausgeblendet. */
#gantt-app [hidden] {
    display: none!important;
}

/* Kleine Bildschirme: Anpassungen bis 700 Pixel Breite. */
@media(max-width:700px) {
    #gantt-app {
        --side: 180px; /* Breite der linken Aufgabenliste */
        border-radius: 0;
        height: 100dvh;
    }

    #gantt-app .top,
    #gantt-app .tools {
        padding: 14px;
    }

    #gantt-app .left {
        padding: 0 12px;
    }

    #gantt-app h1 {
        font-size: 19px;
    }

    #gantt-app .spacer {
        display: none;
    }

    #gantt-app .foot {
        padding: 10px 14px;
    }

}

/* ==========================================================================
   9. Eintragslisten und ergänzende Formularregeln
   ========================================================================== */

#gantt-app .rowItemsButton {
    display: block;
    text-align: left;
    width: 100%;
    margin: 8px 0;
    padding: 12px;
    border: 1px solid #dce4dc;
    border-radius: 7px;
    background: white;
    color: var(--ink);
}

#gantt-app .row .left {
    padding-left: 28px;
}

#gantt-app .row.group .left {
    padding-left: 20px;
}

#gantt-app .actions {
    flex-wrap: wrap;
}

#gantt-app .fields small {
    color: var(--muted);
    line-height: 1.4;
}

/* ==========================================================================
   10. Projektverwaltung und hervorgehobene Projektauswahl
   ========================================================================== */

#gantt-app .project-tools {
    padding: 12px 26px;
    background: #f0f5ef;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#gantt-app .project-tools label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 650;
}

#gantt-app .project-tools select {
    max-width: 400px;
    padding: 9px;
    border: 1px solid #c8d7c9;
    border-radius: 7px;
    background: white;
    color: var(--ink);
    font-size: 16px;
}

#gantt-app .project-field {
    padding: 15px;
    border-radius: 9px;
    background: #edf4ec;
    font-size: 17px;
    font-weight: 650;
}

#gantt-app .project-field select {
    font-size: 17px;
    font-weight: 650;
}

/* ==========================================================================
   11. Mausverschiebung, Anfasser und Datumsanzeige
   ========================================================================== */

#gantt-app .date-draggable {
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
}

#gantt-app .date-draggable.dragging {
    cursor: grabbing;
    filter: brightness(1.12);
    z-index: 6;
    box-shadow: 0 3px 12px #20372e40;
}

#gantt-app .has-handles.resizable {
    padding-left: 14px;
    padding-right: 14px;
}

/* Unsichtbare Griffzone am Balkenrand; ::after zeichnet den Anfasser. */
#gantt-app .date-handle {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    cursor: ew-resize;
    z-index: 3;
}

/* Anfasser erscheinen nur bei ausreichend breiten Balken. */
#gantt-app .resizable .date-handle {
    display: block;
}

#gantt-app .date-handle.start {
    left: 0;
}

#gantt-app .date-handle.end {
    right: 0;
}

#gantt-app .date-handle:after {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 4px;
    width: 2px;
    border-radius: 2px;
    background: #ffffff85;
}

#gantt-app .date-handle:hover {
    background: #ffffff30;
}

#gantt-app.is-dragging,
#gantt-app.is-dragging * {
    user-select: none;
}

#gantt-app.is-saving .board {
    pointer-events: none;
    opacity: .85;
}

/* Schwebende Datumsanzeige während des Ziehens. */
#gantt-app .drag-tooltip {
    position: fixed;
    z-index: 80;
    background: #263c31;
    color: white;
    padding: 9px 13px;
    border-radius: 7px;
    font-size: 12px;
    pointer-events: none;
    box-shadow: 0 3px 12px #20372e30;
    white-space: nowrap;
}

/* ==========================================================================
   12. Grundfarben, Schrift und äußerer Rahmen – spätere Ergänzung / Überschreibung
   ========================================================================== */

/* Diese spätere Definition aktiviert die berechnete Höhe und setzt
   die Mindesthöhe auf 320px. Sie hat Vorrang vor der ersten Definition. */
#gantt-app {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: var(--gantt-viewport-height,calc(100dvh - 24px));
    min-height: 320px;
}

#gantt-app .top,
#gantt-app .tools,
#gantt-app .project-tools,
#gantt-app .foot,
#gantt-app .horizontal-navigation {
    flex-shrink: 0;
}

/* ==========================================================================
   13. Scrollrahmen und dauerhaft sichtbare Navigation
   ========================================================================== */

#gantt-app .gantt-frame {
    flex: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* ==========================================================================
   14. Diagrammfläche, Zeitachse und fixierte Aufgabenliste – spätere Ergänzung / Überschreibung
   ========================================================================== */

#gantt-app .board {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

#gantt-app .vertical-navigation {
    width: 34px;
    flex: none;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 6px;
    padding: 5px 0;
    background: #f3f6f1;
    border-left: 1px solid var(--line);
}

/* Vertikaler Scrollschieber rechts am Diagramm. */
#gantt-app .vertical-navigation input {
    writing-mode: vertical-lr;
    direction: ltr;
    width: 22px;
    flex: 1;
    min-height: 40px;
    margin: 0;
    accent-color: #5b826d;
}

#gantt-app .horizontal-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f6f1;
    padding: 7px 12px;
    border-top: 1px solid var(--line);
}

/* Horizontaler Scrollschieber unter dem Diagramm. */
#gantt-app .horizontal-navigation input {
    flex: 1;
    min-width: 30px;
    margin: 0;
    accent-color: #5b826d;
}

#gantt-app .scroll-button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #d2dfd1;
    border-radius: 5px;
    background: white;
    color: var(--ink);
    font-size: 17px;
}

#gantt-app .row.group .phase-heading small {
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
}

#gantt-app .row.group .phase-heading strong {
    font-size: 11px;
    font-weight: 700;
}

/* Meilensteine werden in der Leistungsphasenzeile dargestellt. */
#gantt-app .phase-milestone {
    z-index: 3;
}

#gantt-app .board:focus-visible {
    outline: 2px solid #759b81;
    outline-offset: -2px;
}

/* Kleine Bildschirme: Anpassungen bis 700 Pixel Breite. */
@media(max-width:700px) {
    #gantt-app .horizontal-navigation {
        gap: 4px;
        padding: 5px;
    }

    #gantt-app .horizontal-navigation .btn {
        padding: 6px;
        font-size: 11px;
    }

    #gantt-app .foot {
        padding: 6px 10px;
        gap: 8px;
    }

}

