/* style.css - Minimalistisch, modern und schön */

/* --- Globale Einstellungen und Variablen --- */
:root {
    /* Farbpalette: Dezente, erdige Töne mit einem klaren Akzent */
    --primary-color: #6d9f86; /* Ein sanftes Salbei-Grün */
    --primary-dark: #5a806c;
    --secondary-color: #d1d1d1; /* Ein helles, klares Grau */
    --secondary-dark: #a0a0a0;
    --accent-color: #e59779; /* Ein warmer, gedämpfter Terrakotta-Ton */
    --warning-color: #f7b731; /* Dezente Warnfarbe für Hinweise */
    --text-dark: #3a4242; /* Dunkler, aber nicht ganz schwarzer Text */
    --text-light: #f0f2f5; /* Off-White für helle Texte */
    --background-body: #f7f9fa; /* Sehr heller, neutraler Hintergrund */
    --background-card: #ffffff; /* Reines Weiß für Karten */

    /* Dezente, moderne Schatten */
    --shadow-primary: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
    --shadow-inset: inset 1px 1px 4px rgba(0, 0, 0, 0.1);

    /* Modernisierte Radien */
    --border-radius-lg: 1.2rem;
    --border-radius-md: 0.8rem;
    --border-radius-sm: 0.5rem;

    /* Klare, moderne Sans-Serif */
    --font-primary: 'Inter', sans-serif;
    /* Kräftige, aber elegante Sans-Serif für Überschriften */
    --font-heading: 'Poppins', sans-serif;
}

/* --- FUNDAMENTALE LAYOUT-REGELN --- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    /* 'overflow-x: hidden;' wurde entfernt, um Tap-and-Zoom zu ermöglichen */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-body);
    padding-bottom: 80px;
    transition: background-color 0.4s ease;
}

.container {
    width: 98%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.04em;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease-in-out;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
    transform: translateY(-1px);
}

/* --- Header & Sprachauswahl --- */
.header-container {
    background-color: var(--background-body);
    padding: 1.2rem 0;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-primary);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-title-link {
    color: var(--text-dark);
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: color 0.3s ease;
    flex-grow: 1;
    justify-content: center;
}

.app-title-link:hover {
    color: var(--primary-color);
}

.app-logo {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
}

.app-title-text {
    font-size: 2rem;
    line-height: 1.2;
}

/* General button styles within header */
.header-buttons .btn,
.header-top-row .btn {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    border: none;
    background-color: transparent;
    padding: 0.6rem 0.8rem;
    border-radius: var(--border-radius-md);
    box-shadow: none;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.header-buttons .btn:hover,
.header-top-row .btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

.header-buttons .btn:active, .header-buttons .btn:focus,
.header-top-row .btn:active, .header-top-row .btn:focus {
    outline: none;
    box-shadow: var(--shadow-inset);
    transform: translateY(0);
}

/* Right-side buttons container */
.right-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Improved click area for Login/Register links */
.auth-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.auth-links a {
    color: var(--primary-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.auth-links a:hover {
    background-color: var(--background-card);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
}

.auth-links span.separator {
    color: var(--secondary-dark);
}

/* Dropdown menu for languages */
.header-buttons .dropdown-menu,
.header-top-row .dropdown-menu {
    background-color: var(--background-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-primary);
    padding: 0.5rem 0;
    min-width: unset;
}

.header-buttons .dropdown-item,
.header-top-row .dropdown-item {
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.header-buttons .dropdown-item:hover, .header-buttons .dropdown-item.active,
.header-top-row .dropdown-item:hover, .header-top-row .dropdown-item.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    font-weight: 500;
}

/* --- Allgemeine Panel-Styles --- */
.panel-base {
    background-color: var(--background-card);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-primary);
    margin-bottom: 2.5rem;
    transition: all 0.4s ease;
}

.panel-base:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.section-spacing {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}

.explanation-text-wide p {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-size: 1.15rem;
    line-height: 1.7;
}

.explanation-text-wide strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Formular --- */
.search-form .form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.search-form .form-control {
    border: 1px solid var(--secondary-color);
    padding: 1rem 1.2rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-inset);
    font-size: 1.15rem;
    background-color: var(--background-body);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.search-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-inset), 0 0 0 3px rgba(109, 159, 134, 0.2);
    background-color: var(--background-card);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    box-shadow: var(--shadow-inset);
    transform: translateY(0);
}

.search-form .col-md-4.d-grid.align-self-end {
    margin-top: 1rem;
}

/* --- Lade-Animationen --- */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#ai-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#ai-loading-overlay.active {
    display: flex;
}

#ai-loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- Statusmeldung --- */
.alert-custom {
    background-color: var(--background-card);
    color: var(--text-dark);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    box-shadow: var(--shadow-primary);
    font-size: 1.05rem;
}

.alert-icon {
    margin-right: 1.5rem;
    font-size: 2rem;
    color: var(--secondary-dark);
}

/* --- Analysebild und Buttons --- */
.zoom-wrapper {
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 900px;
    width: 100%;
    max-width: 100%;
    min-height: 200px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-primary);
}

.zoom-wrapper.scrollable {
    overflow: auto;
    justify-content: flex-start;
    align-items: flex-start;
    max-height: 200vh;
}

.zoom-image {
    display: block;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
    flex-grow: 0;
    transition: transform 0.3s ease-in-out;
    transform-origin: center center;
}

.zoom-image.zoomed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0) !important;
    transform-origin: center center !important;
    cursor: zoom-out;
    max-width: none !important;
    width: auto !important;
    height: auto !important;
}

.tap-to-zoom-text {
    font-size: 0.95rem;
    color: var(--secondary-dark);
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.action-buttons .btn-secondary {
    background-color: var(--background-card);
    border: 1px solid var(--secondary-color);
    color: var(--text-dark);
    padding: 1rem 2rem;
    border-radius: var(--border-radius-md);
    font-weight: 400;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: var(--shadow-primary);
}

.action-buttons .btn-secondary:hover {
    background-color: var(--background-body);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    color: var(--primary-dark);
}

.action-buttons .btn-secondary:active {
    box-shadow: var(--shadow-inset);
    transform: translateY(0);
}

/* --- Wettervorhersage Iframe --- */
.forecast-container {
    background-color: var(--background-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-primary);
    margin-bottom: 2.5rem;
}

.forecast-container iframe {
    width: 100%;
    min-height: 1200px !important;
    height: auto;
    border: none;
    display: block;
}

/* --- Bilderkarussell --- */
#imageCarousel {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-primary);
}

#imageCarousel .carousel-item img {
    border-radius: var(--border-radius-lg);
    object-fit: cover;
    height: 600px;
    width: 100%;
}

.carousel-indicators [data-bs-target] {
    background-color: var(--primary-color);
    opacity: 0.7;
    transition: all 0.3s ease;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--background-card);
}

.carousel-indicators .active {
    opacity: 1;
    transform: scale(1.3);
    background-color: var(--primary-dark);
}

.carousel-control-prev,
.carousel-control-next {
    width: 7%;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    padding: 1.8rem;
    box-shadow: var(--shadow-primary);
}

/* --- Changelog --- */
.version-header {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.changelog-list {
    list-style: none;
    padding-left: 0;
    font-size: 1rem;
    line-height: 1.8;
}

.changelog-list li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 0.6rem;
}

.changelog-list li::before {
    content: '\2022';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    font-size: 1.3rem;
}


.changelog-list hr {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}


.changelog-list div {
    margin-bottom: 0.6rem;
    color: var(--secondary-dark);
}

/* --- Modals (Share und Cookie Consent) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--background-card);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-primary);
    text-align: center;
    max-width: 520px;
    width: 90%;
    transform: translateY(-80px);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-backdrop.show .modal-content {
    transform: translateY(0);
}

.modal-content h5 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.modal-content p {
    word-break: break-all;
    background-color: var(--background-body);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-inset);
    font-size: 1rem;
    color: var(--text-dark);
}

.modal-close-btn {
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: none;
    padding: 0.8rem 1.6rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 500;
    margin: 0.6rem;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-primary);
}

.modal-close-btn:hover {
    background-color: var(--secondary-dark);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.modal-close-btn:active {
    box-shadow: var(--shadow-inset);
    transform: translateY(0);
}

/* Cookie Consent Bar */
.cookie-consent-bar {
    background-color: var(--text-dark);
    color: var(--text-light);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.3);
}

.cookie-consent-bar p {
    margin: 0;
    font-size: 0.9rem;
    flex-grow: 1;
    text-align: center;
    line-height: 1.6;
}

.cookie-consent-bar .btn-primary {
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 140px;
}

/* Style für den "Scroll to Top"-Button */
#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: var(--text-light);
    cursor: pointer;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    font-size: 1.5rem;
    opacity: 0.8;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
}

#scrollToTopBtn:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* --- Responsive Anpassungen --- */
@media (max-width: 992px) {
    .header-container { padding: 1rem 0; margin-bottom: 2rem; }
    .header-top-row { padding: 0 1rem; }
    .app-logo { width: 40px; height: 40px; }
    .app-title-text { font-size: 1.6rem; }
    .panel-base, .modal-content { padding: 1.5rem; margin-bottom: 1.5rem; }
    .section-spacing { margin-top: 2rem; margin-bottom: 2rem; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .btn-primary { font-size: 1rem; padding: 0.8rem 1.5rem; }
    .search-form .form-control { font-size: 1rem; padding: 0.8rem 1rem; }
    .explanation-text-wide p { font-size: 1rem; }
    #imageCarousel .carousel-item img { height: 500px; }
}

@media (max-width: 768px) {
    .header-container { padding: 0.8rem 0; margin-bottom: 1.5rem; }
    .app-logo { width: 35px; height: 35px; }
    .app-title-text { font-size: 1.4rem; }
    .panel-base { padding: 1.2rem; margin-bottom: 1.5rem; }
    .search-form .form-label { font-size: 0.9rem; }
    .search-form .form-control, .btn-primary { padding: 0.7rem 1.1rem; font-size: 0.95rem; }
    .alert-custom { padding: 1rem; font-size: 0.9rem; }
    .alert-icon { margin-right: 1rem; font-size: 1.5rem; }
    .zoom-wrapper { height: 500px; }
    .action-buttons { flex-direction: row; gap: 0.8rem; }
    .action-buttons .btn-secondary { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    #imageCarousel .carousel-item img { height: 350px; }
    .cookie-consent-bar { flex-direction: column; text-align: center; padding: 1rem 1.5rem; gap: 1rem; }
    .cookie-consent-bar p { font-size: 0.85rem; }
    .cookie-consent-bar .btn-primary { padding: 0.6rem 1.2rem; font-size: 0.85rem; }
    .modal-content { padding: 1.5rem; }
    .modal-content h5 { font-size: 1.6rem; }
    .modal-content p { padding: 0.8rem; font-size: 0.9rem; }
    #scrollToTopBtn { width: 45px; height: 45px; font-size: 1.3rem; }

    /* NEUE REGELN FÜR VOLLE BREITE AUF SMARTPHONES */
    .container {
        padding: 0; /* Entfernt den seitlichen Abstand */
        width: 100%; /* Stellt sicher, dass der Container die volle Breite einnimmt */
        max-width: none; /* Deaktiviert die maximale Breite */
    }

    .panel-base {
        padding: 1.5rem; /* Setzt den Innenabstand der Boxen */
        border-radius: 0; /* Entfernt die abgerundeten Ecken */
        box-shadow: none; /* Entfernt den Schatten */
        margin-left: 0; /* Entfernt den linken Rand */
        margin-right: 0; /* Entfernt den rechten Rand */
    }

    .forecast-container,
    #imageCarousel {
        border-radius: 0; /* Entfernt abgerundete Ecken für volle Breite */
        box-shadow: none; /* Entfernt Schatten für eine nahtlose Optik */
    }
}

@media (max-width: 576px) {
    .header-container { padding: 0.5rem 0; margin-bottom: 1rem; }
    .header-top-row { padding: 0 0.8rem; }
    .app-logo { width: 30px; height: 30px; }
    .app-title-text { font-size: 1.2rem !important; }
    .panel-base { padding: 0.8rem; margin-bottom: 1rem; }
    .section-spacing { margin-top: 1.5rem; margin-bottom: 1.5rem; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    .explanation-text-wide p { font-size: 0.85rem; line-height: 1.5; }
    .search-form .form-control, .btn-primary { padding: 0.6rem 1rem; font-size: 0.85rem; }
    .alert-custom { padding: 0.8rem; font-size: 0.8rem; }
    .alert-icon { margin-right: 0.8rem; font-size: 1.2rem; }
    .zoom-wrapper { height: 350px; }
    .action-buttons { gap: 0.6rem; }
    .action-buttons .btn-secondary { padding: 0.6rem 1.2rem; font-size: 0.85rem; }
    #imageCarousel .carousel-item img { height: 250px; }
    .changelog-list { font-size: 0.9rem; }
    .modal-content { padding: 1.2rem; }
    .modal-content h5 { font-size: 1.4rem; }
    .modal-content p { font-size: 0.8rem; }
    .modal-close-btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
    .cookie-consent-bar { flex-direction: column; text-align: center; padding: 0.8rem 1rem; }
    .cookie-consent-bar p { font-size: 0.8rem; }
    .cookie-consent-bar .btn-primary { padding: 0.5rem 1rem; font-size: 0.8rem; }
    #scrollToTopBtn { width: 40px; height: 40px; font-size: 1.2rem; bottom: 1rem; right: 1rem; }
}


/* --- Verbesserte Regel für die Bildskalierung auf Handys --- */
@media (max-width: 480px) {
    .zoom-image.zoomed {
        /* Zentriert das gezoomte Bild und skaliert es */
        transform: translate(-50%, -50%) scale(0.4) !important;
        /* Die beiden unteren Zeilen sind nicht mehr nötig, können aber bleiben */
        max-width: none !important;
        width: auto !important;
        height: auto !important;
    }
}
