:root {
    /* Dark Theme Palette */
    --color-primary-accent: #a1e9ff; /* Helles Blau als Akzent */
    --color-secondary-accent: #b26cb8; /* Lila/Magenta als Akzent */
    
    --color-background-dark: #1a1a2e; /* Dunkelblau/Violett als Haupt-BG */
    --color-background-medium: #162447; /* Etwas hellerer BG für Sektionen */
    --color-background-light: #222f5b; /* BG für Kacheln/Elemente */

    --color-text-light: #f2f3f3; /* Haupttextfarbe (auch für Segel) */
    --color-text-medium: #c0c0c0; /* Sekundäre Textfarbe */
    --color-text-dark-placeholder: #333; 

    --font-main: 'Roboto', sans-serif;
}

/* Basis-Reset und Body-Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    background-color: var(--color-background-dark);
    color: var(--color-text-light);
    overflow-x: hidden; 
}

.container { 
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Preloader Styling */
#preloader {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background-dark); 
    z-index: 9999; 
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-out 0.5s, visibility 0.8s ease-out 0.5s; 
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    position: relative; 
}

.preloader-content p {
    color: var(--color-primary-accent);
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 10px; 
}

/* CSS-Boot Styling in Logofarben */
.css-boat {
    width: 150px; 
    height: 120px; 
    position: relative;
    margin: 0 auto; 
    animation: sailAcrossScreen 4s cubic-bezier(0.65, 0.05, 0.36, 1) forwards;
}

.boat-body {
    width: 100px;
    height: 40px;
    background-color: var(--color-secondary-accent, #b26cb8); 
    border-radius: 0 0 50px 50px / 0 0 30px 30px; 
    position: absolute;
    bottom: 20px; 
    left: 25px; 
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.mast {
    width: 8px;
    height: 70px;
    background-color: #80c9e6; 
    position: absolute;
    bottom: 55px; 
    left: 71px; 
    z-index: 1;
}

.sail {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 60px solid var(--color-text-light, #f2f3f3); 
    position: absolute;
    bottom: 60px; 
    left: 35px; 
    transform: rotate(-5deg); 
    z-index: 3;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.15));
}

.modern-water {
    width: 100%; 
    height: 50px; 
    position: absolute;
    bottom: -10px; 
    left: 0;
    overflow: hidden;
    z-index: 0; 
}

.wave-svg {
    display: block;
    position: absolute;
    left: 0;
    bottom: 0; 
    width: 200%; 
    height: 100%; 
    animation: svgWaveAnim 4s linear infinite;
}

.wave-svg-back {
    opacity: 0.6;
    animation-duration: 5.5s; 
    animation-delay: -0.8s; 
    bottom: -5px; 
}

@keyframes svgWaveAnim {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes sailAcrossScreen {
    0% { transform: translateX(-120vw) translateY(10px) rotate(-2deg); opacity: 0; }
    15% { transform: translateX(0) translateY(0) rotate(0deg); opacity: 1; }
    80% { transform: translateX(0) translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateX(120vw) translateY(-20px) rotate(3deg); opacity: 0; }
}

/* Allgemeine Stile für Full-Height Sektionen */
.full-height-section {
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;     
    padding: 40px 0; 
    position: relative; 
    overflow: hidden; 
}

/* Hero Sektion */
#hero {
    /* background-image wird entfernt, da es vom ::before übernommen wird */
    color: var(--color-text-light);
    text-align: center;
    border-bottom: 3px solid var(--color-primary-accent);
    position: relative; /* Wichtig für ::before Positionierung */
    z-index: 1; /* Stellt sicher, dass der Inhalt über dem ::before liegt */
}

#hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(26, 26, 46, 0.75), rgba(22, 36, 71, 0.9)), /* Overlay etwas stärker */
        url('bg1.webp'); 
    background-size: cover; 
    background-position: center center; 
    background-attachment: fixed; 
    filter: blur(2px); /* Stärke des Blur-Effekts anpassen */
    z-index: -1; /* Legt das Pseudo-Element hinter den Inhalt der Sektion */
    /* Optional: Skalierung, um Kantenunschärfe durch Blur zu kompensieren */
    transform: scale(1.05); 
}
.container { 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#logo {
    max-width: 150px; 
    height: auto; 
    margin-bottom: 20px;
}

#hero h1 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--color-primary-accent);
}

#hero .subtitle {
    font-size: 1.4em;
    margin-bottom: 30px;
    font-weight: 300;
    color: var(--color-text-medium);
}

.cta-button {
    display: inline-block;
    background-color: var(--color-secondary-accent);
    color: var(--color-text-light);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: #935496; 
    transform: translateY(-2px);
    box-shadow: 0 0 10px var(--color-secondary-accent);
}

.smoke-animation {
    position: absolute;
    bottom: -50px;
    left: 50%;
    width: 200%;
    height: 200px;
    background: radial-gradient(circle, rgba(161, 233, 255, 0.05) 0%, rgba(161, 233, 255, 0) 70%); 
    border-radius: 50%;
    animation: smoke 25s linear infinite alternate;
    transform-origin: center bottom;
    opacity: 0.7;
    z-index: -1; 
}

@keyframes smoke {
    0% { transform: translateX(-50%) translateY(0) scale(1); opacity: 0.2; }
    50% { transform: translateX(-40%) translateY(-30px) scale(1.2); opacity: 0.5; }
    100% { transform: translateX(-60%) translateY(-10px) scale(1.1); opacity: 0.3; }
}

/* Willkommens-Sektion */
#welcome {
    background-image: 
        linear-gradient(rgba(22, 36, 71, 0.8), rgba(26, 26, 46, 0.9)), 
        url('bg2.webp'); /* Annahme: Dieses Bild ist bereits weichgezeichnet */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed; 
}
#welcome .container {
    text-align: center;
}

#welcome h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--color-primary-accent);
}

.welcome-text p {
    margin-bottom: 15px;
    font-size: 1.1em;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-text-medium);
}
.welcome-text p:first-of-type {
    color: var(--color-text-light); 
}

/* Tabak-Katalog Sektion */
#tobacco-catalog {
    background-image: 
        linear-gradient(rgba(26, 26, 46, 0.85), rgba(22, 36, 71, 0.92)), 
        url('bg3.webp'); /* Annahme: Dieses Bild ist bereits weichgezeichnet */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed; 
}
#tobacco-catalog .container {
    display: flex;
    flex-direction: column;
    height: 100%; 
    width: 100%; 
    max-width: 1100px; 
    padding-left: 20px;
    padding-right: 20px;
}

#tobacco-catalog h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 10px; 
    color: var(--color-primary-accent);
    flex-shrink: 0; 
}
.catalog-intro {
    text-align: center;
    margin-bottom: 15px; 
    font-size: 1.1em;
    color: var(--color-text-medium);
    flex-shrink: 0; 
}

.loading-message {
    text-align: center;
    font-size: 1.2em;
    padding: 20px;
    color: var(--color-text-medium);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 15px; 
    padding: 10px 15px; 
    background-color: var(--color-background-light); 
    border-radius: 8px;
    border: 1px solid #303f70;
    gap: 15px; 
    flex-shrink: 0; 
}

.filter-controls div {
    display: flex;
    align-items: center;
    gap: 10px; 
}

.filter-controls label {
    font-weight: bold;
    color: var(--color-text-medium);
}

.filter-controls select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #303f70;
    background-color: var(--color-background-dark); 
    color: var(--color-text-light);
    font-size: 0.95em;
    min-width: 180px; 
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--color-primary-accent);
    box-shadow: 0 0 5px var(--color-primary-accent);
}

#tobacco-list {
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 10px 5px; 
    scrollbar-width: thin;
    scrollbar-color: var(--color-secondary-accent) var(--color-background-light);
}
#tobacco-list::-webkit-scrollbar {
    width: 8px;
}
#tobacco-list::-webkit-scrollbar-track {
    background: var(--color-background-light);
    border-radius: 10px;
}
#tobacco-list::-webkit-scrollbar-thumb {
    background-color: var(--color-secondary-accent);
    border-radius: 10px;
    border: 2px solid var(--color-background-light);
}

.tobacco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 15px; 
}

.tobacco-tile {
    background-color: var(--color-background-light);
    border: 1px solid #303f70; 
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tobacco-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--color-primary-accent);
    border-color: var(--color-primary-accent);
}

.tobacco-tile img {
    width: 100%;
    /* height: 170px; /* Alte feste Höhe entfernt */
    aspect-ratio: 1 / 1; /* NEU: Erzwingt quadratisches Format */
    object-fit: cover;   /* Stellt sicher, dass das Bild den Bereich füllt und korrekt zugeschnitten wird */
    border-bottom: 1px solid #303f70;
}

.tobacco-tile .tile-content {
    padding: 15px; 
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.tobacco-tile h3 {
    font-size: 1.3em; 
    margin-bottom: 6px;
    color: var(--color-text-light);
}

.tobacco-tile .brand,
.tobacco-tile .flavor {
    font-size: 0.9em; 
    color: var(--color-text-medium);
    margin-bottom: 4px;
}
.tobacco-tile .brand strong,
.tobacco-tile .flavor strong {
    color: var(--color-text-light);
}

.tobacco-tile .rating-display {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.1em; 
    color: var(--color-text-medium);
}

.tobacco-tile .rating-display strong {
    color: var(--color-text-light);
}

.tobacco-tile .note-value {
    display: inline-block;
    padding: 4px 8px;
    margin-left: 5px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.2em; 
    min-width: 35px; 
    text-align: center;
    color: var(--color-text-light); 
    transition: background-color 0.3s ease; 
}

/* Farbklassen für Noten */
.note-grade-1 { background-color: #28a745; } 
.note-grade-2 { background-color: #84c45c; } 
.note-grade-3 { background-color: #ffc107; } 
.note-grade-4 { background-color: #fd7e14; } 
.note-grade-5 { background-color: #dc3545; } 
.note-grade-6 { background-color: #a0232f; } 
.note-grade-unrated { 
    background-color: #4a5577; 
    color: var(--color-text-medium);
}

.tobacco-tile .notes {
    font-size: 0.85em; 
    color: var(--color-text-medium);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed #303f70;
}

/* Footer */
footer {
    background-color: var(--color-background-medium);
    color: var(--color-text-medium);
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #303f70;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .full-height-section {
        min-height: auto; 
        padding-top: 60px;
        padding-bottom: 60px;
    }
    #hero h1 { font-size: 2.5em; }
    #hero .subtitle { font-size: 1.2em; }
    
    #tobacco-catalog .container {
        height: auto; 
    }
    #tobacco-list {
        overflow-y: visible; 
        padding-right: 0; 
    }
    .tobacco-grid { 
        grid-template-columns: 1fr; 
        gap: 15px;
    }
    .tobacco-tile img { height: 150px; }
    .tobacco-tile h3 { font-size: 1.2em; }
}

@media (max-width: 600px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch; 
    }
    .filter-controls div {
        width: 100%; 
        justify-content: space-between; 
    }
    .filter-controls select {
        flex-grow: 1; 
    }
}