/* ==========================================================================
   1. Schriftarten & Grund-Styling
   ========================================================================== */

@font-face {
    font-family: 'DIN 2014';
    src: url('/assets/fonts/DIN-2014-Normal/DIN-2014_Regular.woff2') format('woff2'),
         url('/assets/fonts/DIN-2014-Normal/DIN-2014_Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'DIN 2014';
    src: url('/assets/fonts/DIN-2014-Normal/DIN-2014_Extra-Bold-Italic.woff2') format('woff2'),
         url('/assets/fonts/DIN-2014-Normal/DIN-2014_Extra-Bold-Italic.woff') format('woff');
    font-weight: 800;
    font-style: italic;
}

body {
    font-family: 'DIN 2014', system-ui, sans-serif;
    padding: 2em;
    background-color: #f3f4f6;
    color: #1f2937;
    line-height: 1.6;
}

.container {
    max-width: 800px; /* Die ursprüngliche, kompakte Breite für das Formular */
    margin-left: auto;
    margin-right: auto;
    background-color: white;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Eine zusätzliche "Modifikator"-Klasse nur für breite Layouts */
.container--wide {
    max-width: 1200px; /* Genug Platz für die Admin-Tabelle */
}

h1 {
    font-family: 'DIN 2014', sans-serif;
    font-weight: 800;
    font-style: italic;
    font-size: 1.75em;
    margin-bottom: 1em;
    color: #000000;
}

/* ==========================================================================
   2. Allgemeines Formular-Styling
   ========================================================================== */

fieldset {
    border: none;
    padding: 0;
    margin-bottom: 2em;
}

legend {
    font-weight: 600;
    font-size: 1.2em;
    margin-bottom: 1em;
    padding: 0;
    color: #111827;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-top: 5px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-grid {
    display: grid;
    gap: 1.5em;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   3. Komponenten für Konfigurator (Akkordeon, Dropdown, Tooltip)
   ========================================================================== */

/* Animation für das Firmen-Eingabefeld */
#company-name-wrapper {
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin-bottom 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    margin-bottom: 0 !important;
    border-width: 0;
    padding: 0;
}
#company-name-wrapper.is-visible {
    max-height: 100px; /* Genug Platz für Label und Input */
    opacity: 1;
    margin-bottom: 1em !important;
}

.feature-header {
    background-color: #f9fafb;
    padding: 12px 16px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5em;
}
.feature-header:hover { background-color: #f3f4f6; }
.arrow-icon { transition: transform 0.3s ease; }
.feature-group.is-open .arrow-icon { transform: rotate(180deg); }
.feature-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    padding-left: 1em;
    border: 1px solid transparent;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* Custom Dropdown */
.custom-dropdown { position: relative; display: inline-block; width: 100%; }
.dropdown-selected { background-color: #f9fafb; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.dropdown-selected::after { content: ''; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #6b7280; }
.dropdown-options { display: none; position: absolute; background-color: #e9e6e6; width: 100%; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1); border: 1px solid #d1d5db; border-radius: 6px; z-index: 10; margin-top: 4px; }
.custom-dropdown.is-open .dropdown-options { display: block; }
.dropdown-option { color: black; padding: 12px 16px; text-decoration: none; display: block; cursor: pointer; }
.dropdown-option:hover { background-color: #bfc1c3; }

/* Tooltip */
.tooltip-container { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.info-icon { font-family: serif; font-weight: bold; font-style: italic; border: 1px solid #9ca3af; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; line-height: 16px; text-align: center; color: #9ca3af; margin-left: 8px; margin-right: 10px; }
.tooltip-text { visibility: hidden; width: 220px; background-color: #374151; color: #fff; text-align: left; border-radius: 6px; padding: 10px; position: absolute; z-index: 1; bottom: 125%; left: 50%; margin-left: -110px; opacity: 0; transition: opacity 0.3s; font-size: 0.9em; font-style: normal; }
.tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: #374151 transparent transparent transparent; }
.tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; }


/* ==========================================================================
   4. Admin-Bereich: Navigation & Filter
   ========================================================================== */

.navigation-buttons {
    margin-bottom: 2em;
    padding-bottom: 1em;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.nav-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background-color: rgb(31, 151, 182); 
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}
.nav-button:hover {
    background-color: rgb(38, 184, 221); /* Helleres Blau für den Hover-Effekt */
}
.nav-button.active {
    background-color: rgb(38, 184, 221); /* Der aktive Button ist jetzt ebenfalls heller */
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* NEU: Eigene Klasse für den Einstellungen-Button */
.nav-button--settings {
    background-color: #6b7280; /* Grau */
}
.nav-button--settings:hover {
    background-color: #5a6268; /* Dunkleres Grau beim Hover */
}
.filter-bar {
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 2em;
    border: 1px solid #ddd;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile First: Eine Spalte */
    gap: 15px;
    align-items: flex-end;
}
@media (min-width: 992px) {
    .filter-grid { grid-template-columns: repeat(4, 1fr); }
}

.filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* ==========================================================================
   5. Admin-Bereich: Tabelle & Aktionen
   ========================================================================== */

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    word-break: break-word;
    vertical-align: middle;
}

th { background-color: #f2f2f2; }
tr:nth-child(even) { background-color: #f9f9f9; }

.table-loading-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex; justify-content: center; align-items: center;
    font-weight: bold; z-index: 10;
}

.actions-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}
.actions-container form { margin: 0; }

.action-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin: 0;
    border: none;
    border-radius: 4px;
    color: rgb(53, 52, 52);
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.action-btn:hover { opacity: 0.3; }
.btn-edit { background-color: #f59f0b; }
.btn-archive { background-color: #22c55e; }
.btn-delete { background-color: #ef4444; }

/*   =================================================
     STYLING FÜR DROPDOWN-PFEIL IN DER FILTERLEISTE 
     ==================================================*/

.filter-group select {
    /* Schritt 1: Verstecke den Standard-Pfeil in allen Browsern */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Schritt 2: Füge unseren eigenen Pfeil als Hintergrundbild hinzu (ein sauberes SVG) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 1.25em;

    /* Schritt 3: Platziere den Pfeil exakt nach deinen Wünschen! */
    /* "right 10px" bedeutet 10px vom rechten Rand entfernt, was mehr Abstand ist als der Standard */
    background-position: right 10px center;

    /* Extra Abstand rechts, damit der Text nicht unter den neuen Pfeil läuft */
    padding-right: 30px; 
}