/* ==================== Apex Express — Custom Styles ==================== */

/* Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scroll-behavior: smooth;
}

::selection {
    background-color: #2563EB;
    color: white;
}

/* Smooth scroll offset for fixed navbar */
html {
    scroll-padding-top: 100px;
}

/* Nav link active state */
.nav-link.active {
    color: #2563EB;
}

/* Category button selected state */
.category-btn.selected {
    border-color: #2563EB;
    background-color: #EFF6FF;
}

.category-btn.selected i {
    color: #2563EB;
}

.category-btn.selected span {
    color: #1E40AF;
}

/* Service option selected */
.service-option:has(input:checked) {
    border-color: #2563EB;
    background-color: rgba(37, 99, 235, 0.03);
}

/* Wizard step transitions */
.wizard-step {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fit check states */
.fit-check-ok {
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

.fit-check-warn {
    background-color: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}

.fit-check-no {
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

/* Pulse animation for availability indicator */
@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

/* Price highlight animation */
@keyframes priceReveal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.price-reveal {
    animation: priceReveal 0.4s ease-out;
}

/* Focus ring for accessibility */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
    background: #94A3B8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748B;
}

/* Shake Animation für Validierung */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.animate-shake {
    animation: shake 0.4s ease-out;
}

/* Sticky CTA Bar */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #E5E7EB;
    padding: 12px 0;
    z-index: 40;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.sticky-cta.visible {
    transform: translateY(0);
}

/* ==================== Security Kachel Animationen ==================== */

/* --- GPS Tracking Kachel --- */
.gps-route-progress {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: gpsRouteReveal 6s ease-in-out infinite;
}

@keyframes gpsRouteReveal {
    0% { stroke-dashoffset: 400; }
    80% { stroke-dashoffset: 0; }
    90% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 400; }
}

.gps-progress-bar {
    animation: gpsProgress 6s ease-in-out infinite;
}

@keyframes gpsProgress {
    0% { width: 15%; }
    80% { width: 92%; }
    90% { width: 92%; }
    100% { width: 15%; }
}

.gps-eta-text {
    animation: etaPulse 3s ease-in-out infinite;
}

@keyframes etaPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Zustellnachweis (POD) Kachel --- */
.pod-scan-line {
    animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
    0% { transform: translateY(-100%); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

.pod-field {
    opacity: 0;
    transform: translateX(-10px);
    animation: podFieldAppear 0.5s ease-out forwards;
}

@keyframes podFieldAppear {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Endlos-Loop: Felder erscheinen nacheinander, dann Reset */
.pod-field:nth-child(1) { animation-delay: 0.5s; }
.pod-field:nth-child(2) { animation-delay: 1.2s; }
.pod-field:nth-child(3) { animation-delay: 1.9s; }

/* Signature Path Animation */
.signature-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: signatureDraw 2s ease-out 2.5s forwards;
}

@keyframes signatureDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Checkmark Overlay */
.pod-checkmark {
    opacity: 0;
    animation: podCheckAppear 0.6s ease-out 4s forwards;
}

@keyframes podCheckAppear {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.pod-check-icon {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: checkDraw 0.4s ease-out 4.2s forwards;
}

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

/* --- Versicherungs-Kachel --- */
.insurance-ring-1 {
    animation: ringPulse1 4s ease-in-out infinite;
}

.insurance-ring-2 {
    animation: ringPulse2 4s ease-in-out infinite 0.5s;
}

@keyframes ringPulse1 {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.15); opacity: 0.1; }
}

@keyframes ringPulse2 {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 0.05; }
}

.insurance-shield {
    animation: shieldFloat 3s ease-in-out infinite;
}

@keyframes shieldFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.shield-check-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: shieldCheckDraw 0.8s ease-out 1s forwards;
}

@keyframes shieldCheckDraw {
    to { stroke-dashoffset: 0; }
}

.insurance-ticker-item {
    opacity: 0;
    transform: translateY(8px);
    animation: tickerAppear 0.5s ease-out forwards;
}

@keyframes tickerAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.insurance-ticker-item:nth-child(1) { animation-delay: 0.8s; }
.insurance-ticker-item:nth-child(2) { animation-delay: 1.3s; }
.insurance-ticker-item:nth-child(3) { animation-delay: 1.8s; }

/* Table responsive */
@media (max-width: 640px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Hero background pattern */
#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Booking wizard shadow hover */
#booking .rounded-3xl:hover {
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.08);
}

/* Step label active styles */
.wizard-step-label.active {
    color: #2563EB;
    font-weight: 600;
}

.wizard-step-label.completed {
    color: #16A34A;
}

/* Loading state for submit button */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Responsive fixes */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem !important;
    }

    .category-btn {
        padding: 0.75rem;
    }
}

/* Print styles */
@media print {
    nav, footer, .fixed, #booking {
        display: none !important;
    }

    body {
        color: black;
        background: white;
    }
}
