/**
 * Promotion Eyecatcher Styles
 * Fixed position promotional widget - DEZENT & RUND
 */

/* CSS Variables from Company settings */
:root {
    --eyecatcher-primary: var(--atw-primary, #667eea);
    --eyecatcher-secondary: var(--atw-secondary, #764ba2);
}

.atr-eyecatcher {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
    background: linear-gradient(135deg, var(--eyecatcher-primary), var(--eyecatcher-secondary)) !important;
    color: white !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    overflow: hidden !important;
    width: 80px !important;
    height: 80px !important;
    cursor: pointer !important;
}

.atr-eyecatcher-right {
    right: 20px !important;
}

.atr-eyecatcher-left {
    left: 20px !important;
}

/* Expanded state - AUCH RUND! */
.atr-eyecatcher.expanded {
    width: 300px !important;
    height: auto !important;
    border-radius: 30px !important;
    cursor: default !important;
    padding-bottom: 20px !important;
}

/* Minimized state (default) */
.atr-eyecatcher:not(.expanded) .atr-eyecatcher-content {
    display: none !important;
}

.atr-eyecatcher:not(.expanded) .atr-eyecatcher-toggle {
    display: flex !important;
}

.atr-eyecatcher:not(.expanded) .atr-eyecatcher-close {
    display: none !important;
}

/* Expanded state */
.atr-eyecatcher.expanded .atr-eyecatcher-toggle {
    display: none !important;
}

.atr-eyecatcher.expanded .atr-eyecatcher-content {
    display: block !important;
}

.atr-eyecatcher.expanded .atr-eyecatcher-close {
    display: flex !important;
}

/* Pulsing indicator - dezenter */
.atr-eyecatcher-pulse {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    width: 12px !important;
    height: 12px !important;
    background: #ef4444 !important;
    border-radius: 50% !important;
    animation: pulse 2s infinite !important;
}

.atr-eyecatcher-left .atr-eyecatcher-pulse {
    right: auto !important;
    left: 5px !important;
}

.atr-eyecatcher.expanded .atr-eyecatcher-pulse {
    display: none !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Close button */
.atr-eyecatcher-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border: none !important;
    color: white !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.atr-eyecatcher-close svg {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
}

.atr-eyecatcher-left .atr-eyecatcher-close {
    right: auto !important;
    left: 10px !important;
}

.atr-eyecatcher-close:hover {
    background: rgba(0, 0, 0, 0.4) !important;
    transform: rotate(90deg) !important;
}

/* Content */
.atr-eyecatcher-content {
    padding: 20px !important;
    padding-top: 45px !important;
    text-align: center !important;
}

/* Badge */
.atr-eyecatcher-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    padding: 6px 14px !important;
    border-radius: 15px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 12px !important;
    display: inline-block !important;
    animation: slideInDown 0.6s ease !important;
}

/* Discount */
.atr-eyecatcher-discount {
    font-size: 42px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    margin-bottom: 8px !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s both !important;
}

/* Text */
.atr-eyecatcher-text {
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin-bottom: 16px !important;
    opacity: 0.95 !important;
    animation: fadeIn 0.6s ease 0.4s both !important;
}

/* Countdown */
.atr-eyecatcher-countdown {
    background: rgba(255, 255, 255, 0.15) !important;
    padding: 10px !important;
    border-radius: 10px !important;
    margin-bottom: 16px !important;
    animation: fadeIn 0.6s ease 0.6s both !important;
}

.atr-countdown-label {
    font-size: 10px !important;
    opacity: 0.85 !important;
    margin-bottom: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.atr-countdown-timer {
    font-size: 18px !important;
    font-weight: 700 !important;
    font-family: 'Courier New', monospace !important;
}

.atr-countdown-timer span {
    display: inline-block !important;
    min-width: 20px !important;
    text-align: right !important;
}

/* CTA Button */
.atr-eyecatcher-cta {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: white !important;
    color: var(--eyecatcher-primary) !important;
    padding: 12px 24px !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
    animation: bounceIn 0.6s ease 0.8s both !important;
}

.atr-eyecatcher-cta:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
    color: var(--eyecatcher-secondary) !important;
}

.atr-eyecatcher-cta svg {
    transition: transform 0.3s ease !important;
    width: 14px !important;
    height: 14px !important;
    display: block !important;
}

.atr-eyecatcher-cta:hover svg {
    transform: translateX(3px) !important;
}

/* Info text */
.atr-eyecatcher-info {
    margin-top: 12px !important;
    font-size: 10px !important;
    opacity: 0.8 !important;
    line-height: 1.3 !important;
    animation: fadeIn 0.6s ease 1s both !important;
}

/* Toggle button (minimized state - RUNDER KREIS) */
.atr-eyecatcher-toggle {
    display: none !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer !important;
    border: none !important;
    background: transparent !important;
    color: white !important;
    padding: 0 !important;
}

.atr-toggle-icon {
    font-size: 36px !important;
    font-weight: 900 !important;
    margin-bottom: 0 !important;
    line-height: 0.9 !important;
    animation: wiggle 3s ease-in-out infinite !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.atr-toggle-text {
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    margin-top: -2px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

@keyframes wiggle {
    0%, 90%, 100% {
        transform: rotate(0deg);
    }
    92% {
        transform: rotate(-5deg);
    }
    94% {
        transform: rotate(5deg);
    }
    96% {
        transform: rotate(-5deg);
    }
    98% {
        transform: rotate(5deg);
    }
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0 !important;
        transform: translateY(-15px) !important;
    }
    to {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0 !important;
        transform: scale(0.6) !important;
    }
    to {
        opacity: 1 !important;
        transform: scale(1) !important;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0 !important;
    }
    to {
        opacity: 1 !important;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0 !important;
        transform: scale(0.3) translateY(15px) !important;
    }
    50% {
        transform: scale(1.05) !important;
    }
    70% {
        transform: scale(0.95) !important;
    }
    100% {
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .atr-eyecatcher {
        width: 70px !important;
        height: 70px !important;
        right: 15px !important;
    }

    .atr-eyecatcher.expanded {
        width: 280px !important;
    }

    .atr-eyecatcher-content {
        padding: 15px !important;
        padding-top: 40px !important;
    }

    .atr-eyecatcher-discount {
        font-size: 36px !important;
    }

    .atr-eyecatcher-text {
        font-size: 12px !important;
    }

    .atr-eyecatcher-cta {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }

    .atr-toggle-icon {
        font-size: 30px !important;
    }

    .atr-toggle-text {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .atr-eyecatcher {
        width: 60px !important;
        height: 60px !important;
        right: 10px !important;
    }

    .atr-eyecatcher.expanded {
        width: 260px !important;
    }

    .atr-eyecatcher-discount {
        font-size: 32px !important;
    }

    .atr-eyecatcher-badge {
        font-size: 9px !important;
        padding: 5px 12px !important;
    }

    .atr-countdown-timer {
        font-size: 16px !important;
    }

    .atr-toggle-icon {
        font-size: 24px !important;
    }

    .atr-toggle-text {
        font-size: 10px !important;
    }
}

/* Minimal style variant */
.atr-eyecatcher-minimal .atr-eyecatcher-badge {
    display: none !important;
}

.atr-eyecatcher-minimal .atr-eyecatcher-content {
    padding-top: 40px !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .atr-eyecatcher,
    .atr-eyecatcher-badge,
    .atr-eyecatcher-discount,
    .atr-eyecatcher-text,
    .atr-eyecatcher-countdown,
    .atr-eyecatcher-cta,
    .atr-eyecatcher-info,
    .atr-toggle-icon,
    .atr-eyecatcher-pulse {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print: hide eyecatcher */
@media print {
    .atr-eyecatcher {
        display: none !important;
    }
}
