/*
Logo original #d81b60
Para fondo claro sería #d81b60
Para fondo oscuro sería #FCBB15
*/

/* =========================
   HEADER OVER MAP (FIX Z-INDEX)
   ========================= */

.site-header {
    position: relative;
    z-index: 999999 !important;
}

/* Navigation */
#primary-menu {
    position: relative;
    z-index: 999999 !important;
}

/* Dropdown */
#primary-menu .sub-menu {
    position: absolute !important;
    z-index: 999999 !important;
    background: #fff !important;
}

#primary-menu .sub-menu a {
    color: #333 !important;
}    
    
    /* =========================
       TRUFITEC STYLE
       ========================= */
    background: #ffffff !important;
    min-width: 140px;           /* ?? schmaler (vorher 180px) */
    padding: 4px 0;             /* ?? etwas kompakter */
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);

    right: 0;
    left: auto;
}

/* Items */
#primary-menu .sub-menu li {
    border: none !important;
}

/* Links */
#primary-menu .sub-menu li a {
    display: block;
    padding: 10px 16px;         /* ?? etwas enger */
    text-align: right;
    color: #333 !important;
    font-size: 15px;            /* ?? größer (vorher 13px) */
    font-weight: 600;           /* ?? etwas kräftiger */
    white-space: nowrap;
}

/* Hover */
#primary-menu .sub-menu li a:hover {
    background: #f5f5f5 !important;
    color: #d81b60 !important;
}


/* Abstand direkt unter Header entfernen */
.content-area {
    margin-top: 0 !important;
    margin-bottom: 0 !important; /* by ChatGPT */
}

/* Padding entfernen */
.entry-content-wrap {
    padding-top: 0 !important;
}

/* optional: alles flush */
.entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.trufitec-login-required {
    display: flex;                 /* by ChatGPT */
    align-items: center;           /* by ChatGPT */
    justify-content: center;       /* by ChatGPT */

    height: calc(100vh - 80px);    /* by ChatGPT */
    width: 100%;

    text-align: center;
    font-size: 20px;               /* by ChatGPT */
    color: #333;
}



/* MAP */
.trufitec-map-wrapper {
    position: relative;
     height: calc(100vh - var(--trufi-header-height, 80px) - 20px); /* by ChatGPT */
}

#trufitec-map {
    height: 100%; /* by ChatGPT */
    width: 100%;
}

/* Overlay */
.trufitec-filter-overlay {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);

    width: auto; /* by ChatGPT */
    max-width: 95%; /* by ChatGPT */
    min-width: unset; /* by ChatGPT */
    padding: 6px 10px; /* by ChatGPT */
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 8px 12px;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* LEFT / RIGHT */

.trufi-left,
.trufi-right {
    display: flex;
    align-items: center;
    gap: 14px; /* by ChatGPT */
}

.trufi-right{
   margin-left:10px; 
   display:none; /* temporarily disabled #### */
   }

/* FIELD WRAPPER */
.trufi-field {
    display: flex;
    align-items: center;
    gap: 8px; /* by ChatGPT */
}

/* =========================
   ICON SYSTEM (INLINE SVG)
   ========================= */

.trufi-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* SVG direkt steuern */
.trufi-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    stroke: none;
    display: block;
}

.trufi-icon.bus svg {
    width: 28px;   /* leicht größer als vorher */
    height: 28px;
    display: block;
}


/* =========================
   LINE + VEHICLE ? IMMER ROT
   ========================= */

.trufi-left .trufi-icon svg {
    fill: #d81b60; /* by ChatGPT */
}

/* =========================
   DATE + TIME ? STANDARD GRAU
   ========================= */

.trufi-datetime .trufi-icon svg {
    fill: #666; /* by ChatGPT */
}

/* =========================
   DATE + TIME ? ROT WENN LIVE OFF
   ========================= */

.trufitec-filter-overlay:not(.trufi-live-active) .trufi-datetime .trufi-icon svg {
    fill: #d81b60; /* by ChatGPT */
}




/* =========================
   ORGANISATION NAME TOP RIGHT
   ========================= */

.trufitec-org-name {
    position: fixed;        /* ?? wichtig */
    top: 6px;
    right: 32px;

    font-size: 12px;
    color: #666;

    z-index: 999999;
    pointer-events: none;
}


/* =========================
   DATETIME GROUP
   ========================= */

.trufi-datetime {
    display: flex;
    gap: 12px;
}

/* INPUT STYLE */
.trufi-field input,
.trufi-field select {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* --- FIX: REMOVE SELECT ARROW --- */
.trufi-field select {
    appearance: none;           /* by ChatGPT */
    -webkit-appearance: none;   /* by ChatGPT */
    -moz-appearance: none;      /* by ChatGPT */
    background-image: none;     /* by ChatGPT */
}

/* --- OPTIONAL EDGE FIX --- */
.trufi-field select::-ms-expand {
    display: none; /* by ChatGPT */
}

/* DISABLED STATE */
.trufi-field input:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================
   LIVE BUTTON
   ========================= */

.trufi-live {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 16px;
    border-radius: 12px;

    background: #ddd;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    
    white-space: nowrap;   /* Prevents text from wrapping to the next line */
    word-break: keep-all;
}

/* ACTIVE (RED) */
.trufi-live.active {
    background: #d81b60;
    color: #fff;
}

/* LIVE ICON */
.trufi-live-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: currentColor;
    position: relative;
}

/* BROADCAST RINGS */
.trufi-live-icon::before,
.trufi-live-icon::after {
    content: '';
    position: absolute;
    border: 2px solid currentColor;
    border-radius: 50%;
    opacity: 0.4;
}

.trufi-live-icon::before {
    width: 18px;
    height: 18px;
    top: -4px;
    left: -4px;
}

.trufi-live-icon::after {
    width: 26px;
    height: 26px;
    top: -8px;
    left: -8px;
}

/* CHECKBOX VISUAL */
.trufi-check {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: rgba(255,255,255,0.3);
}

}

/* HANDLE */
.trufi-resize-handle {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #444;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
}

/* ROUTE LABEL */
.trufi-route-sign {
    pointer-events: none;
}

/* LEAFLET CLEANUP */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.trufi-vehicle-icon {
    background: transparent !important;
    border: none !important;
}

.trufi-vehicle-icon div {
    box-sizing: content-box;
}

/* CURSOR FORCE */
.trufi-vehicle-cursor-force,
.trufi-vehicle-cursor-force * {
    cursor: zoom-in !important;
}

.trufitec-sim-overlay {
    font-size: 13px !important; /* by ChatGPT */
    padding: 6px 12px !important; /* by ChatGPT */
    text-align: center; /* by ChatGPT */
    max-width: 90%; /* by ChatGPT */
    line-height: 1.2; /* by ChatGPT */
}


/* =========================
   MOBILE OPTIMIZATION
   ========================= */

@media (max-width: 1145px) {

    .trufitec-filter-overlay {
        width: auto !important; /* by ChatGPT */
        max-width: calc(100% - 20px); /* by ChatGPT */
        padding: 6px 8px; /* by ChatGPT */
        flex-wrap: wrap; /* by ChatGPT */
        gap: 6px; /* by ChatGPT */
    }

    .trufi-right {
        display: none; /* by ChatGPT */
    }

    .trufi-left {
        width: 100%; /* by ChatGPT */
        justify-content: center; /* by ChatGPT */
    }

}

/* --- AI ADDITION START: responsive overlay fix --- */

@media (max-width: 1024px) {
    #primary-menu {
        background: #fff !important; /* by ChatGPT */
    }

    #primary-menu .menu-item a {
        color: #333 !important; /* by ChatGPT */
    }

    .trufitec-map-wrapper {
        height: calc(100vh - var(--trufi-header-height, 80px) - 30px); /* by ChatGPT */
    }

}


@media (max-width: 768px) {

    .trufi-field select {
        font-size: 13px; /* by ChatGPT */
        padding: 4px 6px; /* by ChatGPT */
        max-width: 140px; /* by ChatGPT */
    }

    .trufitec-org-name {
        font-size: 11px; /* by ChatGPT */
        right: 16px; /* by ChatGPT */
    }        
}

/* --- AI ADDITION END --- */


/* --- AI ADDITION START: tablet fixes --- */

@media (min-width: 768px) and (max-width: 1145px) {

    .trufitec-filter-overlay {
        width: auto !important; /* by ChatGPT */
        max-width: 90%; /* by ChatGPT */
    }

    .trufitec-map-wrapper {
        height: calc(100vh - var(--trufi-header-height, 80px) - 25px); /* by ChatGPT */
    }

}

/* --- AI ADDITION END --- */