/* ============================================
   KI-LEHREN.DE - MAIN STYLESHEET
   Design: Professional, Educational, Accessible
   ============================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-blue: #2563EB;
    --primary-blue-dark: #1E40AF;
    --accent-green: #10B981;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --border-gray: #E5E7EB;
    
    /* Typography */
    --font-main: 'Merriweather', Georgia, 'Times New Roman', serif;
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    
    /* Container */
    --container-max: 1280px;
    --container-padding: 24px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text-dark);
}

h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-blue-dark);
}

a:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* === LAYOUT === */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--space-3xl) 0;
}

.section-alt {
    background-color: var(--bg-light);
}

/* === HEADER & NAVIGATION === */
.header {
    background-color: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--container-padding);
    max-width: var(--container-max);
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.nav-menu {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--bg-light);
    color: var(--primary-blue);
}

.nav-cta {
    background-color: var(--primary-blue);
    color: var(--bg-white) !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
}

.nav-cta:hover {
    background-color: var(--primary-blue-dark);
    color: var(--bg-white) !important;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* === HERO SECTION === */
.hero {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                url('../images/hero-bg.jpg') center/cover no-repeat;
    color: var(--bg-white);
    padding: var(--space-3xl) 0;
    min-height: 600px;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero h1 {
    color: var(--bg-white);
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--bg-light);
    margin-bottom: var(--space-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-blue-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--bg-white);
    border: 2px solid var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-blue);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
    background-color: var(--primary-blue);
    color: var(--bg-white);
}

/* === TRUST BADGES === */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.badge {
    text-align: center;
    padding: var(--space-lg);
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.badge-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-sm);
    fill: var(--primary-blue);
}

.badge h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.badge p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* === SERVICES GRID === */
.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.service-card {
    background-color: var(--bg-white);
    padding: var(--space-xl);
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    transition: all 0.3s ease;
}

.service-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
    transform: translateY(-4px);
}

.service-icon {
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-md);
    fill: var(--primary-blue);
}

.service-card h3 {
    margin-bottom: var(--space-sm);
}

.service-card p {
    color: var(--text-gray);
    margin-bottom: var(--space-md);
}

/* === TESTIMONIALS === */
.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.testimonial {
    background-color: var(--bg-white);
    padding: var(--space-xl);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--accent-green);
}

.testimonial-text {
    font-style: italic;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
    font-size: 1rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-light);
}

.testimonial-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.testimonial-role {
    font-size: 0.875rem;
    color: var(--text-gray);
}

/* === BLOG PREVIEW === */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.blog-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-gray);
    transition: all 0.3s ease;
}

.blog-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.blog-image {
    width: 100%;
    height: 200px;
    background-color: var(--bg-light);
    object-fit: cover;
}

.blog-content {
    padding: var(--space-lg);
}

.blog-meta {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: var(--space-sm);
}

.blog-card h3 {
    margin-bottom: var(--space-sm);
    font-size: 1.25rem;
}

.blog-excerpt {
    color: var(--text-gray);
    margin-bottom: var(--space-md);
}

/* === CTA BANNER === */
.cta-banner {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: var(--bg-white);
    padding: var(--space-2xl) var(--container-padding);
    border-radius: 16px;
    text-align: center;
    margin: var(--space-3xl) auto;
}

.cta-banner h2 {
    color: var(--bg-white);
    margin-bottom: var(--space-md);
}

.cta-banner p {
    font-size: 1.125rem;
    color: var(--bg-light);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
}

/* === FAQ === */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: var(--space-md);
    background-color: var(--bg-white);
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background-color: var(--bg-light);
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--space-md);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: var(--space-md);
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-gray);
    margin-bottom: var(--space-sm);
}

/* === CONTACT FORM === */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-dark);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-required {
    color: var(--primary-blue);
}

/* === FOOTER === */
.footer {
    background-color: var(--text-dark);
    color: var(--bg-light);
    padding: var(--space-2xl) 0 var(--space-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h3 {
    color: var(--bg-white);
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
}

.footer-section p,
.footer-section a {
    color: var(--bg-light);
    font-size: 0.9rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-xs);
}

.footer-links a:hover {
    color: var(--bg-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-md);
    text-align: center;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    list-style: none;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.footer-nav a {
    font-size: 0.875rem;
}

.copyright {
    font-size: 0.875rem;
    color: var(--text-gray);
}

/* === DOWNLOAD CARDS === */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.download-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.download-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.download-image {
    width: 100%;
    height: 200px;
    background-color: var(--bg-light);
    border-radius: 8px;
    margin-bottom: var(--space-md);
    object-fit: cover;
}

/* === UTILITIES === */
.text-center {
    text-align: center;
}

.text-gray {
    color: var(--text-gray);
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mt-lg {
    margin-top: var(--space-lg);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    :root {
        --container-padding: 16px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    body {
        font-size: 1rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: var(--space-lg) 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero {
        min-height: 400px;
        padding: var(--space-2xl) 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section {
        padding: var(--space-2xl) 0;
    }
    
    .services,
    .testimonials,
    .blog-grid,
    .trust-badges,
    .download-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* === ACCESSIBILITY === */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* === SCROLL ANIMATIONS === */
/* Initial state - elements are invisible and slightly moved down */
.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Visible state - triggered when element enters viewport */
.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for groups of elements */
.fade-in-element:nth-child(1) { transition-delay: 0s; }
.fade-in-element:nth-child(2) { transition-delay: 0.1s; }
.fade-in-element:nth-child(3) { transition-delay: 0.2s; }
.fade-in-element:nth-child(4) { transition-delay: 0.3s; }
.fade-in-element:nth-child(5) { transition-delay: 0.4s; }
.fade-in-element:nth-child(6) { transition-delay: 0.5s; }

/* === BLOG ARTICLE OPTIMIZATIONS === */
/* Disable scroll animations for blog articles - content should be immediately visible */
/* Target: Article pages with centered 800px containers */
.section .container[style*="max-width: 800px"] .fade-in-element,
.section-alt .container[style*="max-width: 800px"] .fade-in-element,
.section .container[style*="max-width: 800px"] > div,
.section-alt .container[style*="max-width: 800px"] > div {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Optimized spacing for blog article headers */
.section .container[style*="max-width: 800px"] h1 {
    margin-bottom: 0.75rem; /* Reduced from default 1.5rem */
}

/* Consistent spacing after metadata before article content */
.section .container[style*="max-width: 800px"] .blog-meta {
    margin-bottom: 1.5rem;
}

/* Ensure article text content starts immediately after header */
.section-alt .container[style*="max-width: 800px"] > div[style*="font-size: 1.125rem"] {
    margin-top: 0;
}

/* Blog article list styling - only affects 800px blog containers */
.section .container[style*="max-width: 800px"] ul,
.section-alt .container[style*="max-width: 800px"] ul {
    margin-left: 2em;
    margin-top: 1em;
    margin-bottom: 1em;
    line-height: 1.6;
}

.section .container[style*="max-width: 800px"] ul li,
.section-alt .container[style*="max-width: 800px"] ul li {
    margin-bottom: 0.5em;
}

/* === HERO SECTION LOAD ANIMATIONS === */
/* Initial state for hero elements - hidden on page load */
.hero-new .hero-pills,
.hero-new h1,
.hero-new .hero-subtitle,
.hero-new .hero-cards,
.hero-new .hero-author {
    opacity: 0;
    transform: translateY(20px);
}

/* Fade-in animations with staggered delays */
.hero-new .hero-pills {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero-new h1 {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.hero-new .hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.hero-new .hero-cards {
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.hero-new .hero-author {
    animation: fadeInUp 0.8s ease-out 1.2s forwards;
}

/* Keyframe animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Individual card animations for extra polish */
.hero-card:nth-child(1) {
    animation-delay: 0.9s;
}

.hero-card:nth-child(2) {
    animation-delay: 1.0s;
}

/* Respect user's motion preferences (Accessibility) */
@media (prefers-reduced-motion: reduce) {
    .fade-in-element {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    /* Disable hero animations for reduced motion */
    .hero-new .hero-pills,
    .hero-new h1,
    .hero-new .hero-subtitle,
    .hero-new .hero-cards,
    .hero-new .hero-author,
    .hero-card {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* === PRINT STYLES === */
@media print {
    .header,
    .footer,
    .nav-toggle,
    .cta-banner {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: black;
    }
}
