/* =========================================================================
   Erfolgswerkstatt - Custom CSS
   Ergänzend zu Tailwind CSS
   ========================================================================= */

/* =========================================================================
   CSS VARIABLES
   ========================================================================= */

:root {
    --color-primary: #e64a19;
    --color-secondary: #eb6d10;
    --color-contrast: #2aa7de;
    --color-dark: #1e1e1e;
    --color-light: #fbfbfb;
}

/* =========================================================================
   TYPOGRAPHY
   ========================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

.subheadline {
    font-weight: 300;
}

/* =========================================================================
   TRANSITIONS
   ========================================================================= */

a, button, input, textarea, select {
    transition: all 0.15s ease-in-out;
}

/* =========================================================================
   FOCUS STYLES
   ========================================================================= */

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(230, 74, 25, 0.1);
}

/* =========================================================================
   NAVBAR (Floating Glassmorphism)
   ========================================================================= */

.ew-navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 30, 0.70);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    z-index: -1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ew-header.is-scrolled .ew-navbar::before {
    background: rgba(30, 30, 30, 0.85);
}

.ew-header.is-scrolled .ew-navbar {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.ew-header.is-scrolled .ew-navbar > div {
    height: 3.75rem; /* 60px */
}

/* =========================================================================
   SCROLLBAR
   ========================================================================= */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* =========================================================================
   MEGA MENU (Desktop)
   ========================================================================= */

.ew-mega-menu > div {
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    background: rgba(30, 30, 30, 0.65);
}

.ew-nav-dropdown:hover .ew-mega-menu {
    opacity: 1;
    visibility: visible;
}

.ew-nav-dropdown:hover .ew-nav-chevron {
    transform: rotate(180deg);
}

/* =========================================================================
   MOBILE NAVIGATION
   ========================================================================= */

#mobile-menu.open {
    opacity: 1;
    visibility: visible;
}

#mobile-menu.open .ew-mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}

.ew-mobile-nav-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.15s ease;
}

#mobile-menu.open .ew-mobile-nav-link:nth-child(1) { transition-delay: 0.08s; }
#mobile-menu.open .ew-mobile-nav-link:nth-child(2) { transition-delay: 0.12s; }
#mobile-menu.open .ew-mobile-nav-link:nth-child(3) { transition-delay: 0.16s; }
#mobile-menu.open .ew-mobile-nav-link:nth-child(4) { transition-delay: 0.20s; }
#mobile-menu.open .ew-mobile-nav-link:nth-child(5) { transition-delay: 0.24s; }
#mobile-menu.open .ew-mobile-nav-link:nth-child(6) { transition-delay: 0.28s; }
#mobile-menu.open .ew-mobile-nav-link:nth-child(7) { transition-delay: 0.32s; }

/* =========================================================================
   LANDING SLIDER
   ========================================================================= */

.ew-landing-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.ew-landing-slide.active {
    opacity: 1;
    z-index: 1;
}

/* Ken Burns zoom */
.ew-landing-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1);
    transition: transform 0s;
}

.ew-landing-slide.active .ew-landing-slide-bg {
    transform: scale(1.08);
    transition: transform 8s ease-out;
}

/* Card entrance */
.ew-landing-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.5s;
}

.ew-landing-slide.active .ew-landing-card {
    opacity: 1;
    transform: translateY(0);
}

/* Dots (same as testimonial) */
.ew-landing-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ew-landing-dots button.active {
    background: var(--color-primary);
    width: 24px;
    border-radius: 4px;
}

/* =========================================================================
   TESTIMONIAL SLIDER
   ========================================================================= */

.testimonial-slider {
    position: relative;
}

.testimonial-prev,
.testimonial-next {
    cursor: pointer;
}

.testimonial-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.testimonial-slide {
    min-width: 100%;
    padding: 0 1rem;
    opacity: 0.3;
    transition: opacity 0.6s ease;
}

.testimonial-slide.active {
    opacity: 1;
}

.testimonial-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.testimonial-dots button.active {
    background: var(--color-primary);
    width: 24px;
    border-radius: 4px;
}

/* =========================================================================
   PROCESS SLIDER (6-Schritte horizontal)
   ========================================================================= */

.ew-process-slider {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    /* Left padding matches max-w-site container alignment */
    padding-left: max(1rem, calc((100vw - 1400px) / 2 + 1rem));
    padding-bottom: 1rem;
}

@media (min-width: 640px) {
    .ew-process-slider {
        padding-left: max(1.5rem, calc((100vw - 1400px) / 2 + 1.5rem));
    }
}

@media (min-width: 1024px) {
    .ew-process-slider {
        padding-left: max(2rem, calc((100vw - 1400px) / 2 + 2rem));
    }
}

.ew-process-slider::-webkit-scrollbar {
    display: none;
}

.ew-process-slider.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.ew-process-track {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-right: 3rem;
}

/* Connecting line – vertically centered, full width */
.ew-process-line {
    position: absolute;
    top: 50%;
    left: 18px;
    width: calc(100% - 18px - 3rem);
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, var(--color-primary), #d1d5db 80%);
    z-index: 0;
}

/* Each step = dot (absolute) + card */
.ew-process-step {
    position: relative;
    flex-shrink: 0;
    padding-left: 90px; /* space for gap + dot + gap */
}

.ew-process-step:first-of-type {
    padding-left: 60px;
}

/* Numbered dot – absolutely centered vertically */
.ew-process-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: absolute;
    left: 27px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 0 4px #fbfbfb;
}

.ew-process-step:first-of-type .ew-process-dot {
    left: 12px;
}

.ew-process-dot span {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

/* Card */
.ew-process-card {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
}

@media (min-width: 640px) {
    .ew-process-card {
        width: 280px;
    }
}

/* =========================================================================
   ACCORDION
   ========================================================================= */

.ew-accordion-trigger {
    cursor: pointer;
}

.ew-accordion-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ew-accordion-body > .ew-accordion-inner {
    overflow: hidden;
    min-height: 0;
}

.ew-accordion-item.open .ew-accordion-body {
    grid-template-rows: 1fr;
}

.ew-accordion-icon {
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.ew-accordion-icon svg {
    transition: transform 0.3s ease, color 0.3s ease;
}

.ew-accordion-item.open .ew-accordion-icon {
    border-color: var(--color-primary);
}

.ew-accordion-item.open .ew-accordion-icon svg {
    color: var(--color-primary);
    transform: rotate(45deg);
}

/* =========================================================================
   ARROW LINK (Pfeil-Animation bei Hover)
   ========================================================================= */

.ew-arrow-link svg {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ew-arrow-link:hover svg {
    transform: translateX(4px);
}

/* =========================================================================
   GRADIENT BUTTON
   ========================================================================= */

.ew-btn-gradient {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-primary));
    background-size: 200% 200%;
    background-position: 0% 50%;
    transition: background-position 0s;
}

.ew-btn-gradient:hover {
    animation: gradient-shift 1.5s ease infinite;
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================================================
   TEXT HIGHLIGHT (Marker-Effekt)
   ========================================================================= */

.ew-mark {
    position: relative;
    display: inline;
    white-space: nowrap;
    isolation: isolate;
}

.ew-mark::before {
    content: '';
    position: absolute;
    left: -0.15em;
    right: -0.15em;
    bottom: 0.05em;
    height: 0.35em;
    background: var(--color-contrast);
    opacity: 0.45;
    border-radius: 2px;
    transform: skewX(-6deg) scaleX(0);
    transform-origin: left;
    z-index: -1;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ew-mark.is-visible::before {
    transform: skewX(-6deg) scaleX(1);
}

/* =========================================================================
   SCROLL REVEAL
   ========================================================================= */

.ew-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ew-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================================
   PARALLAX SECTIONS
   ========================================================================= */

.ew-parallax {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

@supports (-webkit-touch-callout: none) {
    /* iOS does not support background-attachment: fixed */
    .ew-parallax {
        background-attachment: scroll;
    }
}

/* =========================================================================
   LOADING SPINNER
   ========================================================================= */

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 0.6s linear infinite;
}

/* =========================================================================
   AOS: Disable on mobile (< lg breakpoint)
   ========================================================================= */

@media screen and (max-width: 1023px) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* =========================================================================
   TOAST NOTIFICATIONS
   ========================================================================= */

.ew-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.ew-toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-size: 0.875rem;
    line-height: 1.4;
    color: #374151;
    pointer-events: auto;
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    max-width: 360px;
}

.ew-toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.ew-toast.is-leaving {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
}

.ew-toast-icon {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
}

.ew-toast-message {
    flex: 1;
    min-width: 0;
}

.ew-toast-close {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.15s ease;
    background: none;
    border: none;
    padding: 0;
}

.ew-toast-close:hover {
    color: #374151;
}

/* Progress bar */
.ew-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: width linear;
}

/* Type colors */
.ew-toast--success { border-left: 3px solid #22c55e; }
.ew-toast--success .ew-toast-icon { color: #22c55e; }
.ew-toast--success .ew-toast-progress { background: #22c55e; }

.ew-toast--error { border-left: 3px solid #ef4444; }
.ew-toast--error .ew-toast-icon { color: #ef4444; }
.ew-toast--error .ew-toast-progress { background: #ef4444; }

.ew-toast--warning { border-left: 3px solid #f59e0b; }
.ew-toast--warning .ew-toast-icon { color: #f59e0b; }
.ew-toast--warning .ew-toast-progress { background: #f59e0b; }

.ew-toast--info { border-left: 3px solid #3b82f6; }
.ew-toast--info .ew-toast-icon { color: #3b82f6; }
.ew-toast--info .ew-toast-progress { background: #3b82f6; }

.ew-toast--danger { border-left: 3px solid #ef4444; }
.ew-toast--danger .ew-toast-icon { color: #ef4444; }
.ew-toast--danger .ew-toast-progress { background: #ef4444; }

@media (max-width: 480px) {
    .ew-toast-container {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    .ew-toast {
        max-width: 100%;
    }
}

/* =========================================================================
   PROSE LEGAL (Impressum, Datenschutz, AGB)
   ========================================================================= */

.prose-legal {
    color: #374151;
    font-size: 1rem;
    line-height: 1.75;
}

.prose-legal h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.prose-legal h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.prose-legal h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.25rem;
    margin-bottom: 0.375rem;
}

.prose-legal p {
    margin-bottom: 0.75rem;
}

.prose-legal ul,
.prose-legal ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.prose-legal ul {
    list-style-type: disc;
}

.prose-legal ol {
    list-style-type: decimal;
}

.prose-legal li {
    margin-bottom: 0.25rem;
}

.prose-legal a {
    color: var(--color-primary);
    text-decoration: none;
}

.prose-legal a:hover {
    text-decoration: underline;
}
