/* root ************************************************************************************** */
/* Variables for consistent theming and responsive design*/
:root {
    /* Color variables */
    --primary-color: black;  /* #4a6da7 */
    --secondary-color: #f5a742;
    --text-color: black; /* #333; */
    --text-hover-color: white;
    
    /* Size customization variables */
    --help-panel-width: 33%; /* always  1/3 of the screenwidth for the helppanel */
    --help-panel-height: 100vh;

    /* Layout variables */
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --spacing-unit: 1rem;
    
    /* Responsive variables - Mobile First (320px+) */
    --grid-columns: 1;

    --card-min-height: 300px;
    --cardtopic-min-height: 280px;
    
    --card-min-width: 300px;
    --cardtopic-min-width: 280px;

    --card-title-size: 1.4rem;
    --card-description-size: 0.8rem;
    
    --portal-text-size: clamp(1.4rem, 4vw, 2.8rem); /* make the CSS variable itself responsive */

    --additional-button-size: 1.5rem;
    --additional-button-width: 100%;  /* erstmal überall 100% */ 
    --grid-gap: 1rem;
    --main-content-gap: 1rem;
}

/* Entscheidung ist auf DO-Grün gefallen */ 
:root[data-theme="theme1-DO-Gruen"] {
     
     /* rgba(130,210,140) // HEX: #82d28c   -> this is the 100%-value from the corporate-design-color-specifications */
     /* rgba(192,233,198)                   -> this is the 50%-value from the corporate-design-color-specifications */
     /* rgba(77,126,84)                     -> this is the +40K-value from the corporate-design-color-specifications */

    --theme-main-color: rgba(130,210,140); 
    --theme-header-logo-background-color: rgba(130,210,140); 
    --theme-background-color: rgba(130,210,140); 
    --theme-background-color-lighter: rgba(192,233,198); 
    --theme-card-hover-color: rgba(77,126,84); 
    --theme-logo-url: url('../images/logo_newdesign_statistik_cropped.png');
}

:root[data-theme="theme2-DO-Lila"] {
    --theme-main-color: #b48cff; 
    --theme-header-logo-background-color: #b48cff;
    --theme-background-color: rgba(216, 197, 255);
    --theme-card-hover-color: rgba(108, 84, 153);
    --theme-logo-url: url('../images/logo_newdesign.png');
}

:root[data-theme="theme3-DO-Blau"] {
    --theme-main-color: #00dcff; 
    --theme-header-logo-background-color: #00dcff; 
    --theme-background-color: rgba(128, 237, 255);
    --theme-card-hover-color: rgba(0, 132, 153);
    --theme-logo-url: url('../images/logo_newdesign.png');
}

:root[data-theme="theme4-DO-Rot"] {
    --theme-main-color: #ff6496; 
    --theme-header-logo-background-color: #ff6496; 
    --theme-background-color: rgba(255,177,202);
    --theme-card-hover-color:  rgba(152,60,90);
    --theme-logo-url: url('../images/logo_newdesign.png');
}

:root[data-theme="theme5-myOrange"] {
    --theme-main-color: #FFA500; /* the darkest orange for title and other elements */
    --theme-header-logo-background-color: #FFA500; /* the darkest orange for title and other elements */
    --theme-background-color: rgba(245, 167, 66, 0.5); /* light orange for the cards */
    --theme-card-hover-color: rgba(245, 167, 66, 0.9); /* darker orange for hovering cards */
    --theme-logo-url: url('../images/logo_textleft.png');
}


/* responsivity ******************************************************************************** */

/* Enhanced Mobile Breakpoint System */

/* iPhone SE and similar (375px and up) */
@media (min-width: 375px) {
    :root {
        --grid-columns: 1;
        --card-min-height: 310px;
        --card-min-width: 310px;
        --card-title-size: 1.35rem;
        --card-description-size: 0.85rem;
        --additional-button-size: 1.55rem;
        --additional-button-width: 100%;
        --grid-gap: 1.2rem;
        --main-content-gap: 1rem;
    }
}

/* iPhone 12/13 and similar (390px and up) */
@media (min-width: 390px) {
    :root {
        --grid-columns: 1;
        --card-min-height: 315px;
        --card-min-width: 315px;
        --card-title-size: 1.4rem;
        --card-description-size: 0.9rem;
        --additional-button-size: 1.6rem;
        --grid-gap: 1.3rem;
    }
}

/* iPhone Plus and similar (414px and up) */
@media (min-width: 414px) {
    :root {
        --grid-columns: 1;
        --card-min-height: 320px;
        --card-min-width: 320px;
        --card-title-size: 1.45rem;
        --card-description-size: 0.95rem;
        --additional-button-size: 1.65rem;
        --grid-gap: 1.4rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    :root {
        --grid-columns: 1;
        --card-min-height: 325px;
        --card-min-width: 325px;
        --card-title-size: 1.3rem;
        --card-description-size: 0.8rem;
        
        --additional-button-size: 1.6rem;
        --additional-button-width: 100%;
        --grid-gap: 1.5rem;
        --main-content-gap: 1rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    :root {
        --grid-columns: 2;
        --card-min-height: 350px;
        --card-min-width: 350px;
        --card-title-size: 1.5rem;
        --card-description-size: 1.0rem;
        
        --additional-button-size: 1.8rem;
        --additional-button-width: 15%; /* oder 100?? */
        --grid-gap: 1.5rem;
        --main-content-gap: 2rem;
    }

    .back-button {
        bottom: 2rem;
        right: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
        font-size: 2rem;
    }
    
    .back-button::after {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
}


@media (max-width: 767px) {  /* here max-mwidth, not min-width! be carefull! */
    .main-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .additional-buttons {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .additional-button {
        flex: 1;
        min-width: 140px;
        font-size: 1.4rem;
        padding: 15px 8px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    :root {
        --grid-columns: 3;
        --card-min-height: 375px;
        --card-min-width: 375px;
        --card-title-size: 1.8rem;
        --card-description-size: 1.2rem;
        
        --additional-button-size: 1.9rem;
        --additional-button-width: 100%;
        --grid-gap: 2rem;
        --main-content-gap: 2rem;
    }
}


/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    :root {
        --grid-columns: 3;
        --card-min-height: 400px;
        --card-min-width: 400px;
        --card-title-size: 2.4rem;
        --card-description-size: 1.2rem;
        
        --additional-button-size: 2rem;
        --additional-button-width: 100%;
        --grid-gap: 2rem;
        --main-content-gap: 2rem;        
    }
}

/* XXL devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    :root {
        --grid-columns: 3;
        --card-min-height: 425px;
        --card-min-width: 425px;
        --card-title-size: 2.6rem;
        --card-description-size: 1.2rem;
        
        --additional-button-size: 2rem;
        --additional-button-width: 100%;
        --grid-gap: 2rem;
        --main-content-gap: 2rem;        
    }
}

/* FullHD-monitors: the "standard" for us */
/* FullHD   = 1920x1080 */
/* QHD "2K" = 2560x1440 */
@media (min-width: 1920px) {
    :root {
        --grid-columns: 3; /* Consider still 3 columns for very wide screens */
        --card-min-height: 450px;
        --card-min-width: 500px;
        --card-title-size: 2.8rem;
        --card-description-size: 1.2rem;
        
        --additional-button-size: 2rem;
        --additional-button-width: 50%;
        --grid-gap: 2rem;
        --main-content-gap: 2rem;
    }

    .grid-container {
        max-width: 1800px; /* with this the main-buttons will not get extremly big */
    }

}

s

/* Reset and base styles ****************************************************************************************** */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    /*font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);

    /* erstmal ohne Auswirkung, kann weg? Warum ist das scrolling-preventing jetzt aber ohne Auswirkung? */
    /* line-height: 1.6; */
    /* overflow-x: hidden; prevent horizontal scrolling */
    /* overflow-y: hidden; prevent vertical scrolling */

}

body {
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    position: relative;
}

/* for longer texts like the help-texts  ************************************************************************************** */
p {  
  margin: 1em 0; /* (top/bottom, left/right) */
  /* margin-bottom: 1em; /* or margin-top ... */
}

ul {
  margin: 0 0; 
}

li {
  margin: 0 0; 
}

/* header with background image ************************************************************************************** */
header {
    
    height: clamp(80px, 15vh, 160px);   /* responsive header height // 120px minimum, 240px maximum, 25vh means 25% of viewport height as preferred size */
    /* Alternative approaches: height: min(max(120px, 20vh), 280px); // height: clamp(150px, calc(100px + 10vw), 250px); */

    display: flex;
    justify-content: flex-start;
    align-items: center; /* center items vertically */
    
    /* Entscheidung kein Image zu nutzen sondern nur die main-Farbe */
    /* background-image: url(../images/header_city.jpg); */ 
    background-color: var(--theme-header-logo-background-color);

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    z-index: 10;
    padding: 0 min(20px, 3vw); /* Responsive side padding */
}

/* Combined container for logo and portal text */
.logo-portal-container {
    display: grid; /* Use CSS Grid for better control */
    grid-template-rows: auto auto; /* Two rows: logo, then text */
    justify-items: start; /* Left align both logo and text */
    /*background-color: var(--theme-header-logo-background-color);*/

    gap: clamp(6px, 1vw, 12px); /* Responsive gap between logo and text */    
    /* vorher starr:   gap: 8px; Space between logo and text */

    padding: clamp(8px, 1.5vw, 15px) clamp(10px, 2vw, 20px); /* Responsive inner spacing */
    /* vorher starr:   padding: 10px 12px; /* Inner spacing */

    border-radius: clamp(10px, 2vw, 20px); /* Responsive border radius */
    /* vorher starr:   border-radius: 15px; /* Rounded corners */

   /* ensure container never gets too wide - always leave space for background */
    max-width: calc(100vw - min(40px, 6vw) - 20px); /* account for header padding + extra margin */
    /* alternative more conservative approach: max-width: min(calc(100vw - 80px), 90vw); */

    animation: fadeSlideIn 0.8s forwards;
    transition: transform 0.2s ease, opacity 0.2s ease; /* Smooth hover effect */
}

.logo-portal-container:hover {
    transform: scale(1.02); /* Slight grow on hover for entire container */
    opacity: 0.95; /* Slight fade for feedback */
}

/* Logo container - no background needed anymore */
.logo-container {
    display: flex;
    align-items: center;
}

/* the LOGO is:           a PNG with the size W=1370 H=584, so the logo ratio is: 1370 ÷ 584 = 2.35 */
/* the LOGO-STATISTIK is: a PNG with the size W=1713 H=322, so the logo ratio is: 1713 ÷ 322 = 5.32 */
.logo {
    /* the logo-height a bit bigger as the portaltext-height // using clamp() for truly responsive sizing */
    height: clamp(30px, calc(var(--portal-text-size) * 1.4), 80px);
    width: clamp(160px, calc(var(--portal-text-size) * 1.4 * 5.32), 426px); /* 160px = minimum widht; 426px = maximum width */

    /* alternative approach using min/max functions */
    /* height: min(max(30px, calc(var(--portal-text-size) * 1.4)), 80px); */
    /* width: min(max(70px, calc(var(--portal-text-size) * 1.4 * 2.35)), 188px); */
    

    /* height: calc(var(--portal-text-size) * 1.4);     */
    /* width: calc(var(--portal-text-size) * 1.4 * 2.35);    */
/*    min-width: 50px; /* Minimum width to prevent too small logos */
/*    max-width: 150px; /* Maximum width to prevent oversized logos */ 


    /* exact matching the height of the logo to the portaltext-height: */
    /* height: calc(var(--portal-text-size)); */
    /* width: calc(var(--portal-text-size) * 2.35); */


    background-size: contain; /* Use this instead of object-fit */
    background-repeat: no-repeat;
    /* background-position: left center; /* Align logo to left side of container */
    background-position: center; /* Center logo within its container */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));  
}

.site-icon {
    background-image: var(--theme-logo-url);
}

/* Portal text - no background needed anymore */
.portal-text {
    color: black;
    font-family: 'Poppins', sans-serif;
    
    font-size: clamp(1rem, 4vw, var(--portal-text-size)); /* font size responsive */    
    font-weight: 600;
    letter-spacing: clamp(1px, 0.3vw, 3px); /* responsive letter spacing */
    
    /* Remove individual background properties */
    /* background-color, padding, border-radius moved to parent container */
    
    /* link styling: */
    text-decoration: none; /* Remove underline */
    cursor: pointer; /* Show it's clickable */
    white-space: nowrap; /* Prevent text wrapping */
}

.portal-text:visited,
.portal-text:link {
    color: black; /* Keep your text color regardless of link state */
}

.copyright {
    position: absolute;
    bottom: 5px;
    right: 10px;
    color: white;
    font-size: 0.75rem;
    background-color: rgba(0, 0, 0, 0.5); /* semi-transparent background for readability */
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 11; /* higher than header's z-index: 10 */
}

/* main content styles ************************************************************************************** */

main {
    flex: 1;    
    display: flex;
    justify-content: center;
    align-items: center; /* Changed from center to flex-start */
    
    /* erstmal ohne Auswirkung, kann weg? */
    /* padding: var(--spacing-unit) var(--spacing-unit) calc(var(--spacing-unit) * 2); */
    /* margin-top: -20px;    Pull main content up to overlap with header */
}

/* Replace existing .main-content rule */
.main-content {
    display: flex;
    flex-direction: column;
    padding: min(1.5em, 6%);
    gap: var(--main-content-gap);
    width: 100%;
    max-width: 100%;

    /* older: 
       padding: min(2em, 8%);
       gap: calc(var(--spacing-unit) * 3); /* Add gap between grid and buttons */

}

@media (min-width: 992px) {
    .main-content {
        flex-direction: row;
        padding: min(2em, 8%);
    }
}


.grid-container {
    display: grid;        
    grid-template-columns: repeat(var(--grid-columns), 1fr);     
    gap: var(--grid-gap);  /* before: gap: calc(var(--spacing-unit) * 2); */
    
     /* Ensure all cards in a row have the same height */
    grid-auto-rows: 1fr;
    
    /* hiermit noch experimentieren bis es perfekt ist */
    /* width: 90%; */
}

/* for the main-cards ************************************************************************************** */

.card {
    justify-content: center;
    background-color: var(--theme-background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: grid;
    grid-template-rows: 1fr auto auto; /* image flexible, title and description fixed */
    
    text-decoration: none;
    color: var(--text-color);
    transition: transform var(--transition-speed), 
                box-shadow var(--transition-speed),
                background-color var(--transition-speed);
    overflow: hidden;
    width: 100%;
    min-height: var(--card-min-height);
    min-width: var(--card-min-width);
    aspect-ratio: 16/9; 
    animation: slideIn 1.0s forwards;
}

.cardtopic {
    justify-content: center;
    background-color: var(--theme-background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: grid;
    grid-template-rows: 1fr auto auto; /* image flexible, title and description fixed */
    
    text-decoration: none;
    color: var(--text-color);
    transition: transform var(--transition-speed), 
                box-shadow var(--transition-speed),
                background-color var(--transition-speed);
    overflow: hidden;
    width: 100%;
    min-height: var(--cardtopic-min-height);
    min-width: var(--cardtopic-min-width);
    aspect-ratio: 16/9; 
    animation: slideIn 1.0s forwards;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    background-color: var(--theme-card-hover-color);
}

.card-image {
    grid-row: 1;
    /* height: 100%; */
    /* width: 100%; */
    overflow: hidden;
    display: flex; /* use flexbox for centering */
    justify-content: center; /* center horizontally */
    align-items: center; /* center vertically */
}

/* for the pictures themselves */
.card-image img {
    width: 95%;
    height: 95%;
    object-fit: contain; /* changed from cover to contain to prevent cropping */
    display: block;
    transition: transform var(--transition-speed);
    padding: 5px; /* Add slight padding to prevent edge bleeding */
}

.cardtopic-image {
    grid-row: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Add these for better icon container behavior */
    position: relative;
    min-height: 0; /* Important for grid items */
}

.cardtopic-image i {
    /* Make icon responsive to container size */
    /*font-size: min(15vw, 8vh, 6rem); /* Responsive size with max limit */
    
    /* Alternative approach - use container-relative sizing */
    font-size: clamp(2rem, 8vw, 6rem); 
    
    /* Or use container dimensions directly */
    /* font-size: calc(min(100%, 100%) * 0.6); */
    
    color: var(--text-color);
    transition: transform var(--transition-speed), color var(--transition-speed);
    
    /* Ensure centering */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Make sure icon doesn't exceed container */
    max-width: 90%;
    max-height: 90%;
}

.card-content, .cardtopic-content { 
    grid-row: 2 / 4; /* Spans both title and description rows */   
    /*height: 50%;*/
    padding: calc(var(--spacing-unit) * 1.5);
    display: flex;
    flex-direction: column;
    
    /* justify-content: space-evenly; */
    gap: 1rem;
}

.card-title, .cardtopic-title {
    font-size: var(--card-title-size);
    font-weight:800;
    text-align: center;
    color: var(--text-color);

     /* Fixed height ensures all titles align at the same level */
    height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    flex-shrink: 0; /* Prevent shrinking */
    
    /* margin-bottom: calc(var(--spacing-unit) / 2); */
}

.card-description {
    font-size: var(--card-description-size); 
    line-height: 1.4;
    text-align: center;
    color: var(--text-color);
    /*height: auto;*/
    flex-grow: 1; /* Takes remaining space */
    display: flex;
    align-items: flex-start; /* Align text to top */
    justify-content: center;
    overflow: hidden;
    
    /* Optional: Limit number of lines to prevent overflow */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Adjust number as needed */
    -webkit-box-orient: vertical;
    line-clamp: 3; /* for compatibility with webkit-line-clamp */

    /* padding: 10px; /* padding to create space from edges */
    /* align-items: center; /* Vertically center the text */
    /* justify-content: center; /* Horizontally center the text */       
}


.card:hover .card-image img {
    transform: scale(1.05);
}

.card:hover .card-title {
    color: var(--text-hover-color);
}

.cardtopic:hover .cardtopic-image i {
    transform: scale(1.2);
    color: var(--text-hover-color);
}

.cardtopic:hover .cardtopic-title {
    color: var(--text-hover-color);
}


/* mal ausprobierne paar improvements: */

/* Touch interaction improvements - aufm scrren dann zu kleine cards! 
.card, .cardtopic, .additional-button, .footer-link, .designlink {
    min-height: 44px;
    min-width: 44px;
} */

/* Active states for touch feedback */
.card:active {
    transform: translateY(-2px) scale(0.98);
    transition: transform 0.1s ease;
}

.additional-button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.footer-link:active,
.designlink:active {
    transform: scale(0.95);
    background-color: var(--theme-card-hover-color);
    color: var(--text-hover-color);
}

/* Remove hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
        box-shadow: var(--box-shadow);
        background-color: var(--theme-background-color);
    }
    
    .additional-button:hover {
        transform: none;
        box-shadow: var(--box-shadow);
        background-color: var(--theme-main-color);
        color: black;
    }
}

/* Enhanced button sizing for mobile */
@media (max-width: 768px) {
    .additional-button {
        min-height: 48px;
        padding: 18px 12px;
        font-size: 1.3rem;
    }
    
    .footer-link {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 1.3rem;
    }
}

/* <------------------------------- end customization for the main-cards */


/* additional buttons ************************************************************* */
.additional-buttons {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    width: 30%;
    align-self: top; /* Vertically center buttons */
    /*margin-top: 50px; /* Align with top of grid    vorher: margin-top: calc(var(--spacing-unit) * 2); */
}

.additional-button {
    width: 100%;
    background-color: var(--theme-main-color);
    color: black;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 2.0rem;
    letter-spacing: 0.8px;
    padding: 20px 10px;    
    border-radius: var(--border-radius);
    display: inline-block;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--box-shadow);
    
    /*min-width: 120px;*/
    /*max-width: 200px;*/

    cursor: pointer;
    transition: color var(--transition-speed);
    animation: slideIn 1.0s forwards;
}

.additional-button:hover {
    transform: scale(1.05); /* Slight scale up on hover */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Add shadow on hover */

    color: var(--secondary-color);
    background-color: var(--theme-card-hover-color);
    color: #fff;

}

/* elements especially for subpages  ************************************************************************************** */
.text-container {
    display: flex;
    align-items: flex-start; /* Align items to top */
    max-width: 100rem;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: var(--theme-main-color);
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    font-size: 1.3rem;
    gap: 2rem; /* Space between icon and text */}

/* Text content wrapper */
.text-content {
    flex: 2; /* Take remaining space */
}

.text-content p {
    display: block; /* Ensure paragraphs stack vertically */
    margin-bottom: 1rem; /* Add spacing between paragraphs */
}

.text-content p:last-child {
    margin-bottom: 0; /* Remove margin from last paragraph */
}

/* Icon container - square shape, height matches text content */
.text-icon {
    flex: 1.5; /* Prevent icon from shrinking */
    align-self: stretch; /* Make icon stretch to full height of container */
    background-color: var(--theme-main-color, #007bff); /* Use your theme color or fallback */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* cover = cover the entire container while maintaining aspect ratio */
    /* Alternative: object-fit: contain; - to fit entire image within container */
    border-radius: 8px; /* Match container border radius */
}


.designlink {
    text-decoration: none;
    color: var(--primary-color);
    background-color: var(--theme-background-color-lighter);
    font-size: 1.3rem; /* Increased font size */
    font-weight: 800;
    transition: color var(--transition-speed);
    padding: 0.3rem 1rem;
    border-radius: var(--border-radius);
}

.designlink:hover {
    color: var(--text-hover-color);
    background-color: var(--theme-card-hover-color);
}


/* footer  ************************************************************************************** */
footer {
    padding: calc(var(--spacing-unit) * 0.5); /* Made narrower */
    background-color: var(--theme-main-color);
    display: flex;
    justify-content: flex-end; /* Align to right side (other option: space-between */
    align-items: center;    

    position: relative;
    transform: translateY(100%); /* start footer off-screen */
    animation: slideInFromBottom 0.8s ease-out forwards;
    will-change: transform; /* hint to browser for performance */
}

.footer-links {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
}

.footer-link {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem; /* Increased font size */
    font-weight: 800;
    transition: color var(--transition-speed);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.footer-link:hover {
    color: var(--secondary-color);
    background-color: var(--card-hover-color);
    color: #fff;
}



/* subpage title styling */
.subpage-title {
    position: absolute;
    top: 200px;
    left: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: black;  

    /*background-color: var(--theme-main-color);*/
    /*padding: 20px 15px;*/
    /*border-radius: 15px;*/
}

/* help panel and help button for subpages **********************************************************/

/* Button container for proper alignment */
.floating-buttons-container {
    position: fixed;
    bottom: clamp(20px, 5vh, 60px); /* Responsive bottom position */
    right: clamp(15px, 3vw, 40px); /* Responsive right position */
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: clamp(50px, 2vw, 15px); /* Responsive gap between buttons */
    z-index: 1000 !important;  /* Increased z-index to ensure buttons are above footer and other elements */
    align-items: center; /* Center align buttons horizontally */
    justify-content: center; /* Center align buttons vertically within container */
}

/* Common button styling */
.help-button,
.back-button {
    width: clamp(48px, 12vw, 75px); /* Responsive width */
    height: clamp(48px, 12vw, 75px); /* Responsive height (same as width for perfect circle) */
    border-radius: 50%; /* Make it round */
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 1.0s ease-out forwards;
    font-size: clamp(24px, 6vw, 48px); /* Responsive font size */
    position: relative; /* For tooltip positioning */
    font-weight: bold;
    text-align: center;
    line-height: 1;
    /* Ensure buttons are perfectly aligned */
    flex-shrink: 0;
}

/* Help button specific styling */
.help-button {
    background: linear-gradient(135deg, var(--theme-main-color, #007bff), var(--theme-main-color, #007bff));
    color: white;
    order: 1; /* Help button first (top) */
    margin-bottom: 0; /* Remove any default margin */
}

/* Back button specific styling */
.back-button {
    background: linear-gradient(135deg, var(--theme-main-color, #007bff), var(--theme-main-color, #007bff));
    color: white;
    order: 2; /* Back button second (bottom) */
    margin-top: 0; /* Remove any default margin */
}

/* Hover effects */
.help-button:hover,
.back-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Active/pressed state */
.help-button:active,
.back-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Unified tooltip styling for both buttons */
.help-button::after,
.back-button::after {
    content: attr(data-tooltip); /* Use data-tooltip attribute for content */
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px); /* Responsive padding */
    border-radius: clamp(4px, 1vw, 8px); /* Responsive border radius */
    white-space: nowrap;
    font-size: clamp(0.7rem, 2vw, 0.9rem); /* Responsive font size */
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: clamp(8px, 2vw, 12px); /* Responsive margin */
    z-index: 1001; /* Above buttons */
    /* Add arrow pointer */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none; /* Prevent tooltip from interfering with hover */
}

/* Tooltip arrow */
.help-button::before,
.back-button::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: clamp(4px, 1vw, 6px) solid transparent;
    border-right: clamp(4px, 1vw, 6px) solid transparent;
    border-top: clamp(4px, 1vw, 6px) solid rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: clamp(2px, 0.5vw, 4px);
    z-index: 1001;
    pointer-events: none; /* Prevent arrow from interfering with hover */
}

/* Show tooltip and arrow on hover */
.help-button:hover::after,
.back-button:hover::after,
.help-button:hover::before,
.back-button:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px); /* Slight upward movement */
}

/* Additional styles for better visual hierarchy */
.help-button {
    background: linear-gradient(135deg, var(--theme-main-color, #007bff) 0%, color-mix(in srgb, var(--theme-main-color, #007bff) 80%, white) 100%);
}

.back-button {
    background: linear-gradient(135deg, var(--theme-main-color, #007bff) 0%, color-mix(in srgb, var(--theme-main-color, #007bff) 80%, white) 100%);
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .help-button {
        background: var(--theme-main-color, #007bff);
    }
    
    .back-button {
        background: var(--theme-secondary-color, #6c757d);
    }
}

/* Help panel styling */
.help-panel {
    position: fixed;
    top: 0;
    right: -400px; /* Start hidden off-screen */
    width: 400px; /* Adjust this for different widths */
    height: 100vh; /* Full viewport height - adjust as needed */
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

/* When panel is active/visible */
.help-panel.active {
    right: 0;
}

/* Help panel header */
.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}

.help-header h3 {
    margin: 0;
    color: #333;
}

/* Close button */
.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-button:hover {
    color: #333;
    background-color: #e9ecef;
}

/* Help content */
.help-content {
    padding: 20px;
    line-height: 1.6;
    color: #333;
}


/* Alternative sizing - uncomment and adjust as needed */

.help-panel {
    width: var(--help-panel-width);
    right: calc(-1 * var(--help-panel-width));
    height: var(--help-panel-height);
}


/* loading overlay and spinner ************************************************************* */

/* Content-specific loading overlay */
.content-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* spinner */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--theme-main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* animation keyframes ******************************************************************* */

@keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

@keyframes fadeSlideIn {
    from {
      opacity: 0;
      transform: translateX(-30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }  

/* Footer animation - explicit slide from bottom */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}  

/* Optional: Add subtle pulsing animation for help button to draw attention 
.help-button {
    animation: slideIn 1.0s forwards, pulse 2s infinite 3s; Pulse starts after 3 seconds 
}*/

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* everything for a modal POP-UP ******************************************************************* */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Modal Content */
.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-width: min(800px, 90vw);
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(1);
    transition: transform 0.3s ease;
    animation: modalSlideIn 0.4s ease-out;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

/* Modal Header */
.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-header h2 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color, #333);
}

/* Modal Body */
.modal-body {
    padding: 20px 24px;
    line-height: 1.6;
}

.modal-body p {
    margin: 0 0 16px 0;
    color: #555;
    font-size: 1.2rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-btn-primary {
    background-color: var(--theme-main-color, rgba(192,233,198)); /* hier faellt er auf die backup-Farbe, warum? */
    color: white;
}

.modal-btn-primary:hover {
    background-color: var(--card-hover-color, rgba(245, 167, 66, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

/* Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 16px 20px;
    }
    
    .modal-footer {
        padding: 12px 20px 20px;
    }

    .floating-buttons-container {
        bottom: clamp(15px, 3vh, 40px);
        right: clamp(10px, 2vw, 25px);
        gap: clamp(6px, 1.5vw, 12px);
    }
    
    .help-button,
    .back-button {
        width: clamp(45px, 10vw, 60px);
        height: clamp(45px, 10vw, 60px);
        font-size: clamp(20px, 5vw, 36px);
    }    
}

@media (max-width: 480px) {
    .floating-buttons-container {
        bottom: clamp(10px, 3vh, 30px);
        right: clamp(8px, 2vw, 15px);
    }
    
    .help-button,
    .back-button {
        width: clamp(40px, 8vw, 50px);
        height: clamp(40px, 8vw, 50px);
        font-size: clamp(18px, 4vw, 28px);
    }
}

/* END everything for a modal POP-UP ******************************************************************* */

/* For accessibility improvements ********************************************************************** */

/* Focus indicators */
button:focus, input:focus {
  outline: 2px solid #007acc;
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  button {
    border: 2px solid;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}