/* Simple CMS - Dynamic Frontend Styles */

/* CSS Variables - will be overridden by theme settings */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333333;
    --background-color: #ffffff;
    --font-family: system-ui, -apple-system, sans-serif;
    --font-size: 16px;
    --heading-font: inherit;
    --border-radius: 8px;
    --container-width: 1200px;
    --section-spacing: 80px;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-weight: 600;
    line-height: 1.2;
}

/* Container */
.container {
    max-width: var(--container-width);
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--primary-color) 85%, black);
    border-color: color-mix(in srgb, var(--primary-color) 85%, black);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-success {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Cards */
.card {
    border-radius: var(--border-radius);
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Hero Sections */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    opacity: 0.9;
}

/* Gallery Sections */
.gallery {
    padding: var(--section-spacing) 0;
}

.gallery .card-img-top {
    height: 250px;
    object-fit: cover;
}

/* Content Sections */
.content {
    padding: var(--section-spacing) 0;
}

.content-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Contact Sections */
.contact {
    padding: var(--section-spacing) 0;
    background-color: #f8f9fa;
}

.contact .form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    padding: 12px 15px;
}

.contact .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color), 0.25);
}

/* CTA Sections */
.cta {
    padding: var(--section-spacing) 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

footer a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --section-spacing: 60px;
        --font-size: 15px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 576px) {
    :root {
        --section-spacing: 40px;
        --font-size: 14px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* ============================================
   ANIMATIONEN - Arbeitet mit data-animation Attribut
   Elemente sind von Anfang an unsichtbar!
   ============================================ */

/* Basis: Elemente mit data-animation sind unsichtbar */
[data-animation]:not([data-animation=""]):not([data-animation="none"]),
.animate {
    opacity: 0;
    visibility: hidden;
}

/* Animation-Startpositionen */
.animate.slideInUp,
[data-animation="slideInUp"] {
    transform: translateY(50px);
}

.animate.slideInDown,
[data-animation="slideInDown"] {
    transform: translateY(-50px);
}

.animate.slideInLeft,
[data-animation="slideInLeft"] {
    transform: translateX(-50px);
}

.animate.slideInRight,
[data-animation="slideInRight"] {
    transform: translateX(50px);
}

.animate.zoomIn,
[data-animation="zoomIn"] {
    transform: scale(0.8);
}

.animate.fadeIn,
[data-animation="fadeIn"] {
    transform: translateY(20px);
}

/* VISIBLE STATE - Animation zur Endposition */
/* Langsamer (0.9s) und elegantere Kurve (ease-in-out) */
.animate.visible,
[data-animation].visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
    transition: opacity 0.9s ease-in-out, transform 0.9s ease-in-out;
}

/* Gestaffelte Delays für eleganten Kaskaden-Effekt */
.animate.visible.delay-1 { transition-delay: 0.1s; }
.animate.visible.delay-2 { transition-delay: 0.2s; }
.animate.visible.delay-3 { transition-delay: 0.3s; }
.animate.visible.delay-4 { transition-delay: 0.4s; }
.animate.visible.delay-5 { transition-delay: 0.5s; }
.animate.visible.delay-6 { transition-delay: 0.6s; }

/* Alte Klassen für Rückwärtskompatibilität */
.fade-in {
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
}

.fade-in.visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s ease-in-out, transform 0.9s ease-in-out;
}

.slide-in-left {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50px);
}

.slide-in-left.visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.9s ease-in-out, transform 0.9s ease-in-out;
}

.slide-in-right {
    opacity: 0;
    visibility: hidden;
    transform: translateX(50px);
}

.slide-in-right.visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.9s ease-in-out, transform 0.9s ease-in-out;
}

/* Reduzierte Bewegung für Barrierefreiheit */
@media (prefers-reduced-motion: reduce) {
    .animate,
    .animate.visible,
    [data-animation],
    [data-animation].visible,
    .fade-in,
    .fade-in.visible,
    .slide-in-left,
    .slide-in-left.visible,
    .slide-in-right,
    .slide-in-right.visible {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Utility Classes */
.section-spacing {
    padding: var(--section-spacing) 0;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e9ecef;
        --background-color: #212529;
    }
    
    .card {
        background-color: #343a40;
        border-color: #495057;
    }
    
    .contact {
        background-color: #343a40;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .creator-toolbar,
    .section-controls,
    .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .hero-section {
        background: none !important;
        color: black !important;
    }
}

/* ============================================
   LIGHTBOX STYLES
   ============================================ */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 4px;
    transition: background 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 1rem;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 5px;
    font-size: 0.875rem;
}

/* Mobile Lightbox */
@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        position: fixed;
        top: auto;
        bottom: 20px;
        transform: none;
        font-size: 1.5rem;
        padding: 10px 20px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
    
    .lightbox-close {
        position: fixed;
        top: 15px;
        right: 15px;
    }
}

/* ============================================
   MOBILE ANIMATION OPTIMIERUNG
   Langsamere, elegantere Animationen auf Mobile
   ============================================ */
@media (max-width: 768px) {
    .animate.visible,
    [data-animation].visible {
        transition: opacity 1.1s ease-in-out, transform 1.1s ease-in-out;
    }
    
    .fade-in.visible,
    .slide-in-left.visible,
    .slide-in-right.visible {
        transition: opacity 1.1s ease-in-out, transform 1.1s ease-in-out;
    }
}

/* ============================================
   PERFORMANCE: NICHT-KOMPOSITABLE ANIMATIONEN VERMEIDEN
   Diese Properties sollten KEINE transition haben
   ============================================ */

/* Deaktiviere transitions für problematische Properties */
.article-content,
.article-item,
.col-md-4,
.col-md-12,
.sidebar-overlay,
.sidebar-header,
.sidebar-nav,
.cms-chatbot-widget,
[data-original-fontsize] {
    /* NUR transform und opacity animieren - alles andere instant */
    transition-property: opacity, transform !important;
}

/* Mobile: Keine Animation für Layout-Properties */
@media (max-width: 768px) {
    .article-content,
    .article-item,
    [class*="col-"] {
        /* Sofortige Änderungen ohne Animation */
        transition: opacity 0.3s ease, transform 0.3s ease !important;
    }
}

/* GPU-Beschleunigung für animierte Elemente */
.animate,
[data-animation],
.parallax-bg {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}