/**
 * Scroll Contact Modal Styles
 */

/* Body Scroll Lock wenn Modal offen */
body.scroll-modal-open {
    overflow: hidden;
}

/* Trigger Button verstecken wenn Modal offen */
body.scroll-modal-open #scroll-modal-trigger-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Modal Container */
#scroll-contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#scroll-contact-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Overlay */
.scroll-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
    z-index: 1;
}

/* Modal Content */
.scroll-modal-content {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 100px;
    z-index: 2;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    pointer-events: all;
    transform-origin: center right;
    display: flex;
    flex-direction: column;
}

/* Animationen - vom Button aus */
.scroll-modal-content[data-animation="scale"] {
    animation: modalScaleFromButton 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.scroll-modal-content[data-animation="slide-up"] {
    animation: modalSlideFromButton 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.scroll-modal-content[data-animation="fade-in"] {
    animation: modalFadeFromButton 0.4s ease;
}

@keyframes modalScaleFromButton {
    from {
        transform: translateY(-50%) scale(0.3);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

@keyframes modalSlideFromButton {
    from {
        transform: translateY(-50%) translateX(100px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes modalFadeFromButton {
    from {
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* Close Button */
.scroll-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.scroll-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.scroll-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

/* Modal Body */
.scroll-modal-body {
    padding: 50px 20px 20px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Header */
.scroll-modal-header {
    text-align: center;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.scroll-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.scroll-modal-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Kontakt-Bereich */
.scroll-modal-contact {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-shrink: 0;
    background: white;
}

.scroll-modal-contact-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scroll-modal-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scroll-modal-contact-content {
    flex: 1;
}

.scroll-modal-contact-text {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.scroll-modal-contact-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scroll-modal-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.scroll-modal-contact-item i {
    width: 14px;
    height: 14px;
    color: #2c2c2c;
    flex-shrink: 0;
}

.scroll-modal-contact-item:hover {
    color: #1a1a1a;
}

.scroll-modal-contact-item:hover i {
    color: #1a1a1a;
}

/* Links */
.scroll-modal-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    margin-bottom: 16px;
}

.scroll-modal-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.scroll-modal-link:hover {
    background: #fff;
    border-color: #e0e0e0;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #2c2c2c;
}

.scroll-modal-link-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.scroll-modal-link-icon i {
    width: 16px;
    height: 16px;
    color: #2c2c2c;
}

.scroll-modal-link-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.scroll-modal-link-arrow {
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.2s ease;
}

.scroll-modal-link-arrow i {
    width: 14px;
    height: 14px;
    color: #999;
}

.scroll-modal-link:hover .scroll-modal-link-arrow {
    opacity: 1;
    transform: translateX(0);
}

.scroll-modal-link:hover .scroll-modal-link-arrow i {
    color: #2c2c2c;
}

/* Trigger Button */
#scroll-modal-trigger-btn {
    position: fixed !important;
    bottom: 120px !important;
    right: 24px !important;
    width: 100px !important;
    height: 100px !important;
    border-radius: 50% !important;
    background: white !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    z-index: 99999 !important;
    overflow: visible !important;
    padding: 0 !important;
    animation: triggerPulse 2s ease-in-out infinite !important;
}

#scroll-modal-trigger-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(44, 44, 44, 0.15);
    animation: triggerRipple 2s ease-out infinite;
    pointer-events: none;
}

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

@keyframes triggerRipple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

#scroll-modal-trigger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    animation: none;
}

#scroll-modal-trigger-btn:hover::after {
    animation: none;
    opacity: 0;
}

/* Inner container for image to clip it properly */
#scroll-modal-trigger-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
}

#scroll-modal-trigger-btn img {
    width: calc(100% - 8px) !important;
    height: calc(100% - 8px) !important;
    object-fit: cover !important;
    display: block !important;
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    z-index: 2 !important;
    border-radius: 50% !important;
    clip-path: circle(50% at 50% 50%) !important;
    max-width: none !important;
}

/* Fallback wenn kein Bild gesetzt */
#scroll-modal-trigger-btn:not(:has(img))::before {
    content: '💬';
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Tooltip / Sprechblase */
#scroll-modal-trigger-btn .trigger-tooltip {
    position: absolute !important;
    right: calc(100% + 16px) !important;
    top: 50% !important;
    transform: translateY(-50%) translateX(10px) !important;
    background: white !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    white-space: nowrap !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    z-index: 10 !important;
    display: inline-block !important;
}

/* Pfeil der Sprechblase */
#scroll-modal-trigger-btn .trigger-tooltip::after {
    content: '' !important;
    position: absolute !important;
    right: -8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-style: solid !important;
    border-width: 8px 0 8px 8px !important;
    border-color: transparent transparent transparent white !important;
    filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.1)) !important;
}

/* Tooltip beim Hover anzeigen */
#scroll-modal-trigger-btn:hover .trigger-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) translateX(0) !important;
}

/* Sanfte Slide-in Animation für Tooltip */
@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Mobile: Tooltip ausblenden */
@media (max-width: 768px) {
    #scroll-modal-trigger-btn .trigger-tooltip {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .scroll-modal-content {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        right: 50%;
        transform: translateX(50%) translateY(-50%);
        max-width: 95%;
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .scroll-modal-content[data-animation="scale"] {
        animation: modalScaleFromButtonMobile 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    .scroll-modal-body {
        padding: 32px 24px 24px;
    }
    
    .scroll-modal-avatar {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }
    
    .scroll-modal-header h2 {
        font-size: 20px;
    }
    
    .scroll-modal-header p {
        font-size: 14px;
    }
    
    .scroll-modal-primary-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .scroll-modal-link {
        padding: 12px 14px;
    }
    
    .scroll-modal-link-icon {
        width: 36px;
        height: 36px;
    }
    
    .scroll-modal-link-icon i {
        width: 18px;
        height: 18px;
    }
    
    .scroll-modal-link-text {
        font-size: 14px;
    }
    
    #scroll-modal-trigger-btn {
        width: 80px;
        height: 80px;
        top: auto;
        bottom: 20px;
        right: 20px;
        transform: none;
    }
}

@media (max-width: 480px) {
    .scroll-modal-content {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }
    
    .scroll-modal-content[data-animation="scale"],
    .scroll-modal-content[data-animation="slide-up"],
    .scroll-modal-content[data-animation="fade-in"] {
        animation: modalSlideUpMobile 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    .scroll-modal-body {
        padding: 28px 20px 20px;
    }
    
    .scroll-modal-close {
        top: 12px;
        right: 12px;
    }
}

@keyframes modalScaleFromButtonMobile {
    from {
        transform: translateX(50%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translateX(50%) scale(1);
        opacity: 1;
    }
}

@keyframes modalSlideUpMobile {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Smooth Scrolling für Modal Body */
.scroll-modal-body {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.scroll-modal-body::-webkit-scrollbar {
    width: 4px;
}

.scroll-modal-body::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.scroll-modal-body::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 10px;
}

.scroll-modal-body::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* Accessibility */
.scroll-modal-close:focus,
.scroll-modal-primary-btn:focus,
.scroll-modal-link:focus,
#scroll-modal-trigger-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print */
@media print {
    #scroll-contact-modal,
    #scroll-modal-trigger-btn {
        display: none !important;
    }
}

