/**
 * CleverHund - Custom Styles
 * Extracted and enhanced styles for maintainability and flexibility
 */

/* ============================================
   CSS Custom Properties (Theme Variables)
   ============================================ */
:root {
    /* Color System */
    --color-primary: #5A6855;
    --color-background-light: #FDFDFD;
    --color-background-dark: #1E1E1E;
    --color-text-light: #333333;
    --color-text-dark: #E0E0E0;
    --color-accent-light: #E0E0E0;
    --color-accent-dark: #4A4A4A;

    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-sans: 'Poppins', sans-serif;

    /* Spacing & Sizing */
    --spacing-4: 0.25rem;   /* 4px  */
    --spacing-8: 0.5rem;    /* 8px  */
    --spacing-12: 0.75rem;  /* 12px */
    --spacing-16: 1rem;     /* 16px */
    --spacing-20: 1.25rem;  /* 20px */
    --spacing-24: 1.5rem;   /* 24px */
    --spacing-32: 2rem;     /* 32px */
    --spacing-40: 2.5rem;   /* 40px */
    --spacing-48: 3rem;     /* 48px */
    --spacing-64: 4rem;     /* 64px */
    --spacing-96: 6rem;     /* 96px */

    --spacing-xs: var(--spacing-4);
    --spacing-sm: var(--spacing-8);
    --spacing-md: var(--spacing-16);
    --spacing-lg: var(--spacing-24);
    --spacing-xl: var(--spacing-32);
    --spacing-2xl: var(--spacing-48);
    --spacing-3xl: var(--spacing-64);

    --border-radius: 0.5rem;     /* 8px  */
    --border-radius-lg: 1rem;    /* 16px */
    --border-radius-xl: 2rem;    /* 32px */

    /* Tailwind spacing mapping
       --spacing-4  (0.25rem) -> p-1 / m-1 / gap-1
       --spacing-8  (0.5rem)  -> p-2 / m-2 / gap-2
       --spacing-16 (1rem)    -> p-4 / m-4 / gap-4
       --spacing-24 (1.5rem)  -> p-6 / m-6 / gap-6
       --spacing-32 (2rem)    -> p-8 / m-8 / gap-8
       --spacing-48 (3rem)    -> p-12 / m-12 / gap-12
       --spacing-64 (4rem)    -> p-16 / m-16 / gap-16
       --spacing-96 (6rem)    -> p-24 / m-24 / gap-24
    */

    /* Shadows */
    --shadow-light: 0 10px 30px -5px rgba(0,0,0,0.05);
    --shadow-dark: 0 10px 30px -5px rgba(255,255,255,0.05);

    /* Transitions */
    --transition-base: 0.3s ease;
    --transition-long: 0.6s ease-out;
}

/* ============================================
   Mobile Menu Animations
   ============================================ */
.mobile-menu {
    transition: transform var(--transition-base);
    transform: translateX(100%);
}

.mobile-menu.open {
    transform: translateX(0);
}

/* ============================================
   Navigation Active State
   ============================================ */
/* Active Navigation State for kurse.html */
.page-kurse .nav-link[href="kurse.html"] {
    color: var(--color-primary);
    font-weight: 600;
}

/* ============================================
   Quiz System Styles
   ============================================ */
.quiz-option {
    padding: var(--spacing-24);
    transition: all var(--transition-base);
}

.quiz-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.dark .quiz-option:hover {
    box-shadow: var(--shadow-dark);
}

.quiz-option.selected {
    background-color: var(--color-primary);
    color: var(--color-background-light);
    border-color: var(--color-primary);
}

.quiz-option.selected .dark\:text-text-dark {
    color: var(--color-background-light);
}

/* ============================================
   Section Divider
   ============================================ */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-accent-light), transparent);
}

.dark .section-divider {
    background: linear-gradient(to right, transparent, var(--color-accent-dark), transparent);
}

/* ============================================
   Image Container
   ============================================ */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg); /* 16px - adjusted to grid */
}

.image-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Header Navigation
   ============================================ */
header {
    backdrop-filter: blur(8px);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);
}

/* Mobile: Solid navbar that doesn't overlay content */
@media (max-width: 768px) {
    header {
        position: relative !important;
        background: var(--color-background-light);
        backdrop-filter: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .dark header {
        background: var(--color-background-dark);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    /* Update button colors for solid background */
    header #dark-mode-toggle,
    header #menu-toggle {
        color: var(--color-primary) !important;
    }
    
    .dark header #dark-mode-toggle,
    .dark header #menu-toggle {
        color: var(--color-primary) !important;
    }
}

header nav a {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

header nav a:hover {
    color: var(--color-primary) !important;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-shadow: none;
}

/* ============================================
   Hero Section
   ============================================ */

/* Hero image */
.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Mobile: Use cover to prevent green stripes, adjust position to keep dogs visible */
@media (max-width: 768px) {
    .hero-image {
        object-fit: cover;
        object-position: center 40%;
    }
}

/* Height-based adjustments for mid-range viewports (420-640px) */
@media (max-width: 768px) and (min-height: 420px) and (max-height: 640px) {
    .hero-image {
        object-position: center top;
    }
}

/* Very small heights: keep lower position */
@media (max-width: 768px) and (max-height: 419px) {
    .hero-image {
        object-position: center 45%;
    }
}

/* Larger heights: more centered */
@media (max-width: 768px) and (min-height: 641px) {
    .hero-image {
        object-position: center 35%;
    }
}

/* Mobile: Adjust hero section since navbar is no longer absolute */
@media (max-width: 768px) {
    .hero-image {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    /* Ensure hero section has proper height for mobile */
    .relative.h-screen {
        min-height: 70vh;
        height: auto;
    }
}

@media (max-width: 480px) {
    .relative.h-screen {
        min-height: 65vh;
    }
}

.hero-content {
    z-index: 10;
    max-width: 800px;
    width: 90%;
    margin: 0 auto var(--spacing-32);
    text-align: center;
    padding: var(--spacing-24) var(--spacing-32);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Mobile: Position in lower third of image, flatter card */
@media (max-width: 768px) {
    .hero-content {
        position: absolute;
        bottom: 10%;
        left: 5%;
        right: 5%;
        width: auto;
        max-width: none;
        margin: 0;
        padding: var(--spacing-16) var(--spacing-20);
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-12);
    }
}

@media (max-width: 480px) {
    .hero-content {
        bottom: 8%;
        left: 4%;
        right: 4%;
        padding: var(--spacing-12) var(--spacing-16);
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.875rem;
    }
}

.hero-content h1 {
    margin-bottom: var(--spacing-8);
}

.hero-content p {
    margin-bottom: var(--spacing-16);
}

.dark .hero-content {
    background: rgba(30, 30, 30, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Waldbaden Hero Content - same frosted glass card style */
.waldbaden-content {
    z-index: 10;
    max-width: 800px;
    width: 90%;
    margin: 0 auto var(--spacing-32);
    text-align: center;
    padding: var(--spacing-24) var(--spacing-32);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.waldbaden-content h2 {
    margin-bottom: var(--spacing-12);
}

.waldbaden-content p {
    margin-bottom: var(--spacing-16);
}

.dark .waldbaden-content {
    background: rgba(30, 30, 30, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-primary);
}

.dark h1, .dark h2, .dark h3, .dark h4 {
    color: var(--color-primary);
}

p {
    font-family: var(--font-sans);
    line-height: 1.7;
}

.dark p {
    color: var(--color-text-dark);
}

a {
    transition: color var(--transition-base), transform var(--transition-base);
}

a:hover {
    color: var(--color-primary);
}

.dark a:hover {
    color: var(--color-primary);
}

/* ============================================
   BUTTON SYSTEM (WCAG-Compliant)
   ============================================ */

/* Base Button Styles */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all var(--transition-base);
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
}

/* Primary Button (Main CTAs) */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-background-light);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    box-shadow: 0 10px 25px -5px rgba(90, 104, 85, 0.4);
    transform: scale(1.05);
}

.btn-primary:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Secondary Button (Ghost Style - WCAG AA Compliant) */
.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
    border-width: 2px;
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-background-light);
    transform: scale(1.05);
}

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

.dark .btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-background-light);
}

.btn-secondary:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Full-width Button Variant */
.btn-full {
    width: 100%;
}

/* ============================================
   CARD SYSTEM (Semantic Hover States)
   ============================================ */

/* Base Card Styles */
.card {
    position: relative; /* Enable absolute positioning for badges */
    background-color: var(--color-background-light);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-light);
}

.dark .card {
    background-color: var(--color-background-dark);
    box-shadow: var(--shadow-dark);
}

/* Price Badge (for Training Cards) */
.price-badge {
    position: absolute;
    top: var(--spacing-16);
    right: var(--spacing-16);
    background-color: var(--color-primary);
    color: white;
    padding: var(--spacing-8) var(--spacing-16);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Interactive Cards (for Training Programs with CTAs) */
.card-interactive {
    transition: all var(--transition-base);
}

.card-interactive:hover {
    box-shadow: 0 15px 40px -5px rgba(0,0,0,0.1);
    transform: translateY(-8px);
}

.dark .card-interactive:hover {
    box-shadow: 0 15px 40px -5px rgba(255,255,255,0.1);
}

/* Static Cards (for Testimonials - subtle effect only) */
.card-static {
    transition: box-shadow var(--transition-base);
}

.card-static:hover {
    box-shadow: 0 12px 35px -5px rgba(0,0,0,0.08);
}

.dark .card-static:hover {
    box-shadow: 0 12px 35px -5px rgba(255,255,255,0.08);
}

/* ============================================
   SCROLL ANIMATIONS (Intersection Observer)
   ============================================ */

/* Fade In Up Animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-long), transform var(--transition-long);
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transition: opacity var(--transition-long);
}

.fade-in.is-visible {
    opacity: 1;
}

/* Slide In from Left */
.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity var(--transition-long), transform var(--transition-long);
}

.slide-in-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide In from Right */
.slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity var(--transition-long), transform var(--transition-long);
}

.slide-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up,
    .fade-in,
    .slide-in-left,
    .slide-in-right {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Performance optimization: Only apply will-change during animation */
.fade-in-up:not(.is-visible),
.slide-in-left:not(.is-visible),
.slide-in-right:not(.is-visible) {
    will-change: transform, opacity;
}

.fade-in-up.is-visible,
.slide-in-left.is-visible,
.slide-in-right.is-visible {
    will-change: auto;
}

/* ============================================
   WALDBADEN SECTION RESPONSIVENESS
   ============================================ */
#waldbaden {
    min-height: 60vh;
}

#waldbaden .backdrop-blur-md {
    backdrop-filter: blur(10px);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #waldbaden {
        padding-top: 6rem !important;
        padding-bottom: 6rem !important;
        min-height: auto;
    }

    #waldbaden .backdrop-blur-md {
        padding: 2rem !important;
        margin-left: 1rem;
        margin-right: 1rem;
    }

    #waldbaden h2 {
        font-size: 2rem !important;
        line-height: 1.2;
    }

    #waldbaden p {
        font-size: 1rem !important;
        line-height: 1.6;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    #waldbaden h2 {
        font-size: 2.5rem !important;
    }

    #waldbaden p {
        font-size: 1.125rem !important;
    }
}

/* ============================================
   Pricing Cards (kurse.html)
   ============================================ */
.pricing-card {
    background-color: var(--color-background-light);
    border: 1px solid var(--color-accent-light);
    border-radius: 0.5rem;
    padding: var(--spacing-32);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.dark .pricing-card {
    background-color: var(--color-background-dark);
    border-color: var(--color-accent-dark);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-light);
}

.dark .pricing-card:hover {
    box-shadow: var(--shadow-dark);
}

.pricing-card.featured {
    border-color: var(--color-primary);
    border-width: 2px;
    position: relative;
}

.pricing-card.featured::before {
    content: "Beliebt";
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--color-primary);
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Price Display Styles */
.price-large {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.price-period {
    font-size: 1.125rem;
    color: var(--color-text-light);
    opacity: 0.7;
}

.dark .price-period {
    color: var(--color-text-dark);
}

/* Detail Items with Icons */
.detail-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-8);
    margin-bottom: var(--spacing-12);
}

.detail-item .material-icons,
.detail-item .material-icons-outlined {
    color: var(--color-primary);
    font-size: 1.25rem;
}

/* ============================================
   Button Styles for Pricing Page
   ============================================ */
.btn-outline {
    display: inline-block;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 104, 85, 0.3);
}

.dark .btn-outline:hover {
    box-shadow: 0 4px 12px rgba(90, 104, 85, 0.5);
}

/* ============================================
   FAQ Accordion (kurse.html)
   ============================================ */
.faq-item {
    background-color: var(--color-background-light);
    transition: box-shadow var(--transition-base);
}

.dark .faq-item {
    background-color: var(--color-background-dark);
}

.faq-item:hover {
    box-shadow: var(--shadow-light);
}

.dark .faq-item:hover {
    box-shadow: var(--shadow-dark);
}

.faq-trigger {
    cursor: pointer;
    transition: color var(--transition-base);
}

.faq-trigger:hover {
    color: var(--color-primary);
}

.faq-trigger:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.faq-trigger .material-icons-outlined {
    transition: transform var(--transition-base);
}

.faq-trigger[aria-expanded="true"] .material-icons-outlined {
    transform: rotate(180deg);
}

.faq-content {
    padding-top: var(--spacing-16);
    line-height: 1.7;
}

.faq-content p {
    color: var(--color-text-light);
}

.dark .faq-content p {
    color: var(--color-text-dark);
}
