/* --- File: ./app/static/css/base.css --- */
/* Basisstile, Typografie, Hauptlayout */

/* Universelles Box-Sizing und Reset */
html {
    box-sizing: border-box;
    height: 100%;
    font-size: 100%;
    margin: 0;
    padding: 0;
    scrollbar-gutter: stable;
    /* Theme wird über data-theme Attribut gesteuert */
}
*, *:before, *:after {
    box-sizing: inherit;
}


/* Keyframes für Fade-In Animation */
@keyframes fadeInPage {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Definition der Inter Schriftart */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype');
}

/* Grundlegende Stile */
body {
    /* Hintergrundbild mit halbtransparentem schwarzen Overlay - Theme-spezifisch */
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.8)), url('../img/wallpaper_pixel.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: var(--bg-color); /* Fallback, wird von Theme überschrieben */

    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Ladeanzeige-Balken */
.page-load-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--loader-bar-color, var(--accent-color));
    z-index: 9999;
    transition: width 10s cubic-bezier(0.1, 0.9, 0.2, 1);
    opacity: 0;
    border-radius: 2px;
    box-shadow: 0 0 10px var(--loader-bar-color, var(--accent-color)), 0 0 5px var(--loader-bar-color, var(--accent-color));
}
.page-load-indicator.loading {
    opacity: 1;
    width: 98%;
    transition: width 15s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.page-load-indicator.finished {
    width: 100%;
    opacity: 0;
    transition: width 0.4s ease-out, opacity 0.5s ease-in-out 2s;
}


/* Anpassung des Overlay für Light-Theme */
html[data-theme="light"] body {
  background-image: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3)), url('../img/wallpaper_pixel.jpg');
}


/* Vereinheitlichte Überschriftengrößen mit rem */
h1 {
    color: var(--page-title-color);
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 0.9375rem;
    margin-top: 0;
    margin-bottom: 1.875rem;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 2.0rem;
    line-height: 1.3;
}

/* Genereller Selektor für FontAwesome Icons direkt in H1 */
h1 > i.fa-solid,
h1 > i.fas {
    margin-right: 0.625rem;
    color: var(--accent-color);
    font-size: 0.9em;
}


h2 {
    color: var(--box-h2-color);
    margin-top: 0;
    margin-bottom: 0.9375rem;
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.4;
}

h3 {
    color: var(--box-text-color);
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.4;
}

h4 {
    color: var(--box-text-light);
    margin-top: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.5;
}

h5 {
    color: var(--text-color-light);
    margin-top: 0.9375rem;
    margin-bottom: 0.3125rem;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.5;
}

h6 {
    color: var(--text-color-very-light);
    margin-top: 0.9375rem;
    margin-bottom: 0.3125rem;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.5;
    text-transform: uppercase;
}

h2 > .section-icon {
    margin-right: 0.5rem;
    font-size: 0.8em;
    color: var(--text-color-very-light);
}

/* Link-Styling */
a {
    color: var(--link-color);
    text-decoration: none;
    border-radius: 3px;
    transition: box-shadow 0.2s ease, color 0.2s ease;
}
a:focus {
    outline: none;
}
a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Haupt-Layout-Stile (Header, Navbar, Main, Footer) */
.main-header {
    background-color: var(--header-bg);
    padding: 0 1.25rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    opacity: 1;
    animation: none;
}

.main-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 55px;
}

.main-nav .nav-brand {
    color: var(--header-text);
    font-size: 1.3em;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-brand-icon {
    display: inline-block;
    height: 40px;
    width: auto;
    vertical-align: middle;
    margin-right: 0.5rem;
    filter: none;
}
html[data-theme="light"] .nav-brand-icon {
    filter: invert(90%); /* Macht SVG auf hellem Hintergrund sichtbar */
}


.main-nav ul.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.main-nav ul li {
    margin-left: 0.9375rem;
    height: 100%;
    display: flex;
    align-items: center;
}

.main-nav ul li a {
    color: var(--nav-link-color);
    text-decoration: none;
    padding: 0 0.75rem;
    font-size: 0.95em;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 3px;
}
.main-nav ul li a:focus-visible {
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
    border-bottom-color: transparent;
}


.main-nav ul li a i {
    margin-right: 0.375rem;
    width: 16px;
    text-align: center;
}

.main-nav ul li a:hover {
    color: var(--nav-link-hover-color);
}

.main-nav ul li.active a {
    color: var(--nav-link-active-color);
    border-bottom-color: var(--nav-link-active-border);
}

.main-nav ul li.nav-right {
    margin-left: 0;
}

.main-nav ul li.nav-item-separator {
    margin-left: auto;
    margin-right: 0;
    padding-right: 5px;
    height: 100%;
}

.main-nav ul li.nav-right a i {
    margin-right: 0.5rem;
}

.main-content {
    flex-grow: 1;
    padding: 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    animation: fadeInPage 0.4s ease-out forwards;
    opacity: 0;
}

.main-footer {
    background-color: var(--header-bg);
    color: var(--text-color-very-light);
    text-align: center;
    padding: 0.9375rem 1.25rem;
    font-size: 0.9rem;
    margin-top: 1.875rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    animation: fadeInPage 0.4s ease-out forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.footer-emoji {
    font-size: 1.1em;
    line-height: 1;
}

.footer-visitor-stats {
    font-size: 0.9rem;
    color: var(--text-color-very-light);
    margin-left: 20px;
    border-left: 1px solid var(--border-color);
    padding-left: 15px;
    line-height: 1.2;
}


/* Scrollbar Styling (Webkit-Browser) */
::-webkit-scrollbar {
    width: 0.625rem;
}
::-webkit-scrollbar-track {
    background: var(--input-bg);
    border-radius: 0.3125rem;
}
::-webkit-scrollbar-thumb {
    background: var(--btn-secondary-bg);
    border-radius: 0.3125rem;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--btn-secondary-hover-bg);
}

h1 span.db-indicator {
    font-size: 0.5em;
    color: var(--accent-color);
    vertical-align: middle;
    margin-left: 0.625rem;
    font-weight: normal;
    border: 1px solid var(--accent-color);
    padding: 0.125rem 0.3125rem;
    border-radius: 0.25rem;
}

ul.emoji-bullets {
    list-style-type: none;
    padding-left: 0;
    margin-left: 1.25rem;
}

ul.emoji-bullets li {
    padding-left: 2em;
    position: relative;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

ul.emoji-bullets li::before {
    content: '🐀';
    position: absolute;
    left: 0;
    top: 0px;
    width: 1.5em;
    text-align: center;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--nav-link-color);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.3125rem 0.625rem;
    font-family: inherit;
    border-radius: 4px;
}
.navbar-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}


.navbar-toggle:hover {
    color: var(--nav-link-hover-color);
}

.navbar-theme-toggle {
    background: none;
    border: none;
    color: var(--nav-link-color);
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 10px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    opacity: 0.8;
    transition: color 0.2s, opacity 0.2s, box-shadow 0.2s;
    margin: 0;
    border-radius: 4px;
}
.navbar-theme-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

.navbar-theme-toggle:hover {
    color: var(--nav-link-hover-color);
    opacity: 1;
}

.navbar-theme-toggle i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-theme-text {
    display: none;
    font-size: 0.9em;
    margin-left: 0;
}


li.nav-item-theme-toggle {
    margin-left: 0.5rem;
    margin-right: 0;
}

.nav-login-text {
    display: inline;
}

/* --- Keyframes für animierte Ladebalken --- */
@keyframes rainbow-gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- CSS-Variablen und Klassen für Ladebalken-Stile --- */
:root {
    --loader-bar-color-red: #ff4d4d;
    --loader-bar-color-green: #4caf50;
    --loader-bar-color-blue: #3498db;
    --loader-bar-color-violet: #8e44ad;
    --loader-bar-color-magenta: #e91e63;
    --loader-bar-color-orange: #f39c12;
    --loader-bar-color-yellow: #f1c40f;
    --loader-bar-color-lightblue: #00bcd4;

    --chart-grid-color: rgba(128, 128, 128, 0.2);
    --chart-tick-color: #888;
    --chart-title-color: #777;
    --chart-tooltip-bg: rgba(0, 0, 0, 0.8);
    --chart-tooltip-text: #fff;
    --chart-annotation-color: #FF6347;
    --chart-annotation-bg: rgba(0, 0, 0, 0.7);
    --chart-annotation-label-color: #eeeeee;
    --chart-annotation-period-line-color: rgba(180, 82, 255, 0.5);
    --chart-annotation-period-label-bg: rgba(180, 82, 255, 0.6);
    --chart-annotation-period-label-color: #ffffff;
}

body.loader-style-accent .page-load-indicator {
    --loader-bar-color: var(--accent-color);
}
body.loader-style-red .page-load-indicator       { --loader-bar-color: var(--loader-bar-color-red); }
body.loader-style-green .page-load-indicator     { --loader-bar-color: var(--loader-bar-color-green); }
body.loader-style-blue .page-load-indicator      { --loader-bar-color: var(--loader-bar-color-blue); }
body.loader-style-violet .page-load-indicator    { --loader-bar-color: var(--loader-bar-color-violet); }
body.loader-style-magenta .page-load-indicator   { --loader-bar-color: var(--loader-bar-color-magenta); }
body.loader-style-orange .page-load-indicator    { --loader-bar-color: var(--loader-bar-color-orange); }
body.loader-style-yellow .page-load-indicator    { --loader-bar-color: var(--loader-bar-color-yellow); }
body.loader-style-lightblue .page-load-indicator{ --loader-bar-color: var(--loader-bar-color-lightblue); }

body.loader-style-rainbow .page-load-indicator,
body.loader-style-trans .page-load-indicator,
body.loader-style-nonbinary .page-load-indicator,
body.loader-style-bi .page-load-indicator,
body.loader-style-custom .page-load-indicator {
    background-size: 200% 200%;
    animation: rainbow-gradient 4s ease infinite;
    box-shadow: none;
}

body.loader-style-rainbow .page-load-indicator {
    background-image: linear-gradient(-45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
}
body.loader-style-trans .page-load-indicator {
    background-image: linear-gradient(-45deg, #5BCEFA, #F5A9B8, #FFFFFF, #F5A9B8, #5BCEFA);
}
body.loader-style-nonbinary .page-load-indicator {
    background-image: linear-gradient(-45deg, #FCF434, #FFFFFF, #9C59D1, #2C2C2C, #FCF434);
}
body.loader-style-bi .page-load-indicator {
    background-image: linear-gradient(-45deg, #D60270, #D60270, #9B4F96, #0038A8, #0038A8);
}
