/* Konfigurator Deferred Styles - Non-critical CSS loaded async */

/* Animations */
.animate-pulse-light {
    animation: pulse-light 2s ease-in-out infinite;
    opacity: 0.2;
}

@keyframes pulse-light {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.2; }
}

.animate-shake {
    animation: shake 2.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 20%, 50%, 80%, 100% { transform: translateX(0); }
    40% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
}

/* Produktauswahl-Animation */
@keyframes product-added {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.product-added-animation {
    animation: product-added 0.3s ease-in-out;
}

@keyframes box-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.box-pulse-animation {
    animation: box-pulse 0.5s ease-in-out;
}

/* Button Hover Effects */
.button-hover-lift {
    transition: all 0.2s ease-in-out;
}

.button-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.button-hover-lift:active {
    transform: translateY(0);
}

/* Sticky Support Bar */
.sticky-support-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 102;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .sticky-support-bar {
        bottom: 90px;
        right: 15px;
    }

    .mobile-support-banner {
        position: fixed;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        z-index: 102;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }

    .mobile-support-banner-content {
        background: linear-gradient(135deg, #71c68a, #5fb579);
        color: white;
        padding: 12px 8px;
        border-radius: 8px 0 0 8px;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 1px;
    }

    .mobile-support-banner-content:hover {
        background: linear-gradient(135deg, #5fb579, #4da568);
        transform: translateX(-2px);
    }

    .mobile-support-expanded {
        position: fixed;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        z-index: 102;
        width: calc(100vw - 30px);
        max-width: 320px;
    }
}

/* FAQ Accordion */
.faq-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    border-top: 1px solid transparent;
}

.faq-accordion.open {
    max-height: 300px;
    border-top: 1px solid #e5e7eb;
}

.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
}

.faq-button {
    width: 100%;
    padding: 1rem;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.faq-button:hover {
    background-color: #f9fafb;
}

.faq-content {
    padding: 0 1rem 1rem 1rem;
    background: #fafafa;
}

/* Video Player */
.video-overlay {
    background: linear-gradient(45deg, rgba(113, 198, 138, 0.1), rgba(113, 198, 138, 0.05));
}

.video-controls {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

/* Language Switcher */
.language-switcher {
    position: relative;
    display: inline-block;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 101;
    min-width: 140px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background-color: #f9fafb;
}

.language-option.active {
    background-color: #f0fdf4;
    color: #71c68a;
}

.flag-icon {
    width: 20px;
    height: 14px;
    margin-right: 8px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Live Chat Styles */
.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 103;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.chat-container.open {
    transform: translateY(0);
    opacity: 1;
}

.chat-header {
    background: linear-gradient(135deg, #71c68a, #5fb579);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f9fafb;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.chat-message {
    margin-bottom: 1rem;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.user {
    display: flex;
    justify-content: flex-end;
}

.chat-message.support {
    display: flex;
    justify-content: flex-start;
}

.chat-bubble {
    width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    position: relative;
}

.chat-bubble > div {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.chat-bubble.user {
    background: #71c68a;
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-bubble.support {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 6px;
}

.chat-timestamp {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    padding: 0 0.5rem;
}

.chat-message.user .chat-timestamp {
    text-align: right;
    color: rgba(113, 198, 138, 0.7);
}

.chat-message.support .chat-timestamp {
    text-align: left;
    color: #9ca3af;
}

.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    outline: none;
    resize: none;
    font-size: 0.875rem;
    line-height: 1.25rem;
    max-height: 120px;
    min-height: 40px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-input:focus {
    border-color: #71c68a;
    box-shadow: 0 0 0 3px rgba(113, 198, 138, 0.1);
}

.chat-send-button {
    width: 40px;
    height: 40px;
    background: #71c68a;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
    background: #5fb579;
    transform: scale(1.05);
}

.chat-send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.chat-typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    max-width: 80%;
    margin-bottom: 1rem;
}

.chat-typing-dots {
    display: flex;
    gap: 4px;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Mobile Chat */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 10px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

/* Image Zoom */
.zoom-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.zoom-container img {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.zoom-container:hover img {
    transform: scale(2);
}

.zoom-on-hover {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.zoom-on-hover img {
    transition: none;
    transform-origin: var(--mouse-x, center) var(--mouse-y, center);
}

.zoom-on-hover:hover img {
    transform: scale(2.5);
}
