/* Mobile-first responsive styles */
:root{
    --bg: #dadada; /* Vollfarbiger Hintergrund (keine Helligkeitsänderung am Seitenrand) */
    --bg-image: url('../img/background.jpg'); /* Hintergrundbild */
    --site-width: 80%;
    --content-max: 1400px;
    --nav-bg: rgba(0,0,0,0.85); /* dunkles Menü-Hintergrund (Burger-Menu Farbe) */
    --nav-active: rgba(255,255,255,0.1);
    --nav-hover: rgba(255,255,255,0.05);
}
html,body{
    height:100%;
    margin:0;
    padding:0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--bg);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Hintergrundbild fixiert */
    color:#fff;
    position:relative;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

/* Global link rules: always white, no decoration */
a, a:link, a:visited, a:hover, a:active, a:focus {
    color: #fff !important;
    text-decoration: none !important;
    outline: none !important;
}

/* Ensure content-specific links also follow rule */
.content a, .site-footer a, .nav-item a {
    color: #fff !important;
    text-decoration: none !important;
}

/* Zentriertes Hintergrund-Logo */
body::before {
    content:'';
    position:fixed;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    width:50vw;
    max-width:600px;
    height:50vh;
    background:url('../img/M7logo.png') center/contain no-repeat;
    opacity:0.06; /* noch dezenter, um Kontraständerungen zu vermeiden */
    pointer-events:none;
    z-index:0;
}
.page{
    min-height:100%;
    display:flex;
    flex-direction:column;
    overscroll-behavior: none;
    padding-top: 60px; /* Platz für fixierten Header */
    padding-bottom: 60px; /* Platz für fixierten Footer */
}
.container{
    flex:1 0 auto;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    width: 94%; /* noch engere Container-Breite für iPhone mini */
    max-width: var(--content-max);
    margin: 0 auto;
    padding:1.5rem 0;
    box-sizing:border-box;
    text-align:center;
}
.content{
    background:rgba(255, 255, 255, 0.85);
    padding:1rem 1.25rem;
    border-radius:12px;
    width: 100%;
    position: relative;
    color: #000;
}

.content h1, .content h2, .content h3, .content h4, .content h5, .content h6,
.content p, .content label, .content li, .content span, .content div {
    color: #000;
}

.content a, .content a:link, .content a:visited, .content a:hover, .content a:active {
    color: #000 !important;
    text-decoration: underline !important;
}

/* Buttons und Links in Administration */
.content button,
.content .button,
.content a.button,
.content a.btn-secondary,
.content button.btn-secondary,
.content .form-actions button,
.content input[type="submit"],
.content input[type="button"] {
    color: #fff !important;
    text-decoration: none !important;
}

.content button:hover,
.content .button:hover,
.content a.button:hover,
.content a.btn-secondary:hover,
.content button.btn-secondary:hover {
    color: #fff !important;
    text-decoration: none !important;
}

/* Hilfe-Button oben rechts in der Content-Box */
.help-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgb(190, 6, 98);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s;
}

.help-button:hover {
    background: rgba(190, 6, 98, 0.8);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.1);
    color: #fff !important;
    text-decoration: none !important;
}

/* Überschreibe Content-Link-Styles speziell für Hilfe-Button */
.content .help-button,
.content .help-button:link,
.content .help-button:visited,
.content .help-button:hover,
.content .help-button:active {
    color: #fff !important;
    text-decoration: none !important;
}

/* Form grid: modern, aligned labels and fields */
.form-grid {
    display: grid;
    grid-template-columns: 200px 1fr; /* breitere Label-Spalte für längere Texte */
    gap: 0.5rem 0.75rem; /* engere Abstände */
    align-items: center;
    max-width: 850px; /* breiteres Formular */
    margin: 0 auto;    /* immer horizontal zentrieren */
}
.form-grid label {
    text-align: right;
    padding-right: 0.5rem;
    font-weight: 600;
    opacity: 0.95;
}
.form-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: 400px; /* größere Felder */
    width: 100%; /* füllt verfügbaren Platz bis max-width */
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="date"],
.form-field input[type="password"],
.form-field select,
.form-field textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.9);
    color: #000;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset;
    font-family: inherit;
    font-size: 16px;
    box-sizing: border-box;
}
.form-field input[type="date"] {
    cursor: pointer;
    min-height: 42px;
}
.form-field input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
    margin-left: 4px;
}
.form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23000000' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-color: rgba(255,255,255,0.9);
    padding-right: 2.5rem;
}
.form-field select option {
    background: #fff;
    color: #000;
}
.form-field textarea {
    resize: vertical;
    min-height: 80px;
}
.form-field input::placeholder,
.form-field textarea::placeholder { 
    color: rgba(0,0,0,0.5); 
}
.form-grid small { grid-column: 2 / 3; color: rgba(255,255,255,0.75); margin-top: 0.25rem; }

.form-actions { grid-column: 2 / 3; text-align: left; margin-top: 0.5rem; }

/* Einheitlicher Button-Look für alle Buttons */
button,
.button,
.form-actions button,
input[type="submit"],
input[type="button"],
a.button,
a.button.secondary {
    background: rgb(190, 6, 98);
    color: #fff !important;
    text-decoration: none !important;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-block;
    line-height: 1.5;
    vertical-align: middle;
    box-sizing: border-box;
}

button:hover,
.button:hover,
.form-actions button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
a.button:hover,
a.button.secondary:hover {
    background: rgba(190, 6, 98, 0.678);
    color: #fff !important;
    text-decoration: none !important;
}

/* Gesperrte Felder und Schloss-Icon */
.form-field { position: relative; }
.form-field input[disabled] {
    background: rgba(255,255,255,0.5);
    cursor: not-allowed;
    color: rgba(0,0,0,0.7);
    border: 1px solid rgba(0,0,0,0.15);
}
.locked-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.6;
    pointer-events: none;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgb(190, 6, 98);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Abstand für sekundäre Buttons (z.B. Abmelden) */
.button.secondary,
a.btn-secondary,
button.btn-secondary {
    margin-left: 1rem;
    /* Kleinere Höhe als Speichern-Button */
    padding: 0.3rem 0.6rem;
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
    box-sizing: border-box;
    background: rgb(190, 6, 98);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.button.secondary:hover,
a.btn-secondary:hover,
button.btn-secondary:hover {
    background: rgba(190, 6, 98, 0.678);
}

.message.error { background: rgba(255,200,200,0.9); color: #b00; padding: 0.75rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid #b00; }
.message.success { background: rgba(200,255,200,0.9); color: #080; padding: 0.75rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid #080; }

/* Responsive: stack labels above fields on small screens */
@media (max-width: 599px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid label { text-align: left; padding-right: 0; }
    .form-grid small { grid-column: 1 / 2; }
    .form-actions { grid-column: 1 / 2; text-align: center; }
}

/* Larger screens */
@media (min-width: 600px){
    body::before {
        width:40vw;
        height:60vh;
    }
}
@media (min-width: 1024px){
    .container{ padding:4rem; }
    body::before {
        width:30vw;
        height:70vh;
    }
}

.site-header {
    background: var(--nav-bg);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.site-nav {
    position: relative;
    width: var(--site-width);
    max-width: var(--content-max);
    margin: 0 auto;
}

/* Burger Menu Button */
.nav-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

/* Logo at the left of the navigation, double the burger menu size */
.nav-logo {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 60px; /* double the burger width */
    height: 42px; /* double the burger height */
    background: url('../img/M7logo.png') center/contain no-repeat;
    z-index: 11;
    pointer-events: auto;
}

/* Ensure header content doesn't overlap the centered site-nav */
.site-nav { position: relative; }

.burger-line {
    display: block;
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: transform 0.3s;
}

/* Navigation List */
.nav-list {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--nav-bg); /* dunkler, nicht transparent */
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 200px;
    border-radius: 0 0 8px 8px;
    z-index: 20; /* über dem Hintergrund-Logo */
}

.nav-open .nav-list {
    display: flex;
}

/* Burger Animation */
.nav-open .burger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.nav-open .burger-line:nth-child(2) {
    opacity: 0;
}
.nav-open .burger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav-item a {
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s;
    display: block;
}

.nav-item a:hover {
    background: var(--nav-hover);
}

.nav-item.active a {
    background: var(--nav-active);
}

/* Submenu für Administration */
.nav-item {
    position: relative;
}

.submenu {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-open .submenu {
    display: flex;
}

.submenu li a {
    padding: 0.5rem 1rem 0.5rem 2rem;
    font-size: 0.9em;
    background: rgba(0,0,0,0.2);
}

.submenu li a:hover {
    background: var(--nav-hover);
}

/* Navigation List Positioning */
.nav-list {
    position: absolute;
    right: 1rem;
    top: 45px;  /* Angepasst an die Header-Höhe */
    background: var(--nav-bg); /* dunkler, lesbar */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 20;
}

/* Tours list styles */
.tours-list {
    text-align: left;
    width: 100%;
}

.site-footer {
    text-align:center;
    padding:1rem 0;
    background: var(--nav-bg);
    display: flex;
    justify-content: center;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

.site-footer p {
    width: var(--site-width);
    max-width: var(--content-max);
    margin: 0;
}
