/* Magio Kontakt Popup - Frontend Styles */

/* Root font variable - will be overridden by dynamic CSS */
:root {
    --kontakt-font-family: var(--brz-heading1fontfamily, initial);
}

/* Apply font to all kontakt elements */
.kontakt-trigger-icon,
.kontakt-trigger-text,
.kontakt-popup,
.kontakt-popup-header,
.kontakt-popup-body,
.kontakt-profile-title,
.kontakt-profile-subtitle,
.kontakt-menu-item,
.kontakt-menu-text,
.kontakt-popup-close {
    font-family: var(--kontakt-font-family) !important;
}

/* Konrad Real Estate - Correct Design */

/* Trigger Button - Simple Professional Support Style */
.kontakt-trigger-button {
    position: fixed;
    z-index: 999998;
    cursor: pointer;
    user-select: none;
    display: block !important;
}

.kontakt-trigger-button.bottom-right {
    bottom: 20px !important;
    right: 20px !important;
}

.kontakt-trigger-button.bottom-left {
    bottom: 20px !important;
    left: 20px !important;
}

.kontakt-trigger-button.top-right {
    top: 20px !important;
    right: 20px !important;
}

.kontakt-trigger-button.top-left {
    top: 20px !important;
    left: 20px !important;
}

/* Video Trigger */
.kontakt-trigger-video {
    position: fixed;
    z-index: 999997;
    display: none; /* Skjult som standard, JavaScript viser den hvis cookie tillader det */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kontakt-trigger-video.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

.kontakt-video-mp4 {
    pointer-events: auto;
}

.kontakt-video-gif {
    pointer-events: auto;
}

.kontakt-trigger-video {
    cursor: pointer;
}

/* Trigger Video Close Button */
.kontakt-trigger-video-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
}

.kontakt-trigger-video-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.kontakt-trigger-video-close:active {
    transform: scale(0.95);
}

.kontakt-trigger-video-close svg {
    pointer-events: none;
}

.kontakt-video-mp4::-webkit-media-controls {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-panel {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-play-button {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-timeline {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-current-time-display {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-mute-button {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-volume-slider {
    display: none !important;
}

.kontakt-video-mp4::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.kontakt-trigger-video.bottom-right {
    bottom: 85px;
    right: 20px;
}

.kontakt-trigger-video.bottom-left {
    bottom: 85px;
    left: 20px;
}

.kontakt-trigger-video.top-right {
    top: 85px;
    right: 20px;
}

.kontakt-trigger-video.top-left {
    top: 85px;
    left: 20px;
}

.kontakt-trigger-icon {
    background: linear-gradient(60deg, rgb(226 224 224) 0%, rgb(255 255 255 / 80%) 100%) !important;
    color: #333 !important;
    padding: 10px !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(5.9px) !important;
    -webkit-backdrop-filter: blur(5.9px) !important;
    border: 1px solid rgba(255, 255, 255, 0.31) !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    width: 300px !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    min-height: 60px !important;
    position: relative !important;
    transition: opacity 0.3s ease !important;
}

/* Skjul trigger knap når popup er synlig */
.kontakt-popup-container.show .kontakt-trigger-icon {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

.kontakt-trigger-text {
    color: #333 !important;
    font-weight: 400 !important;
    font-size: 17px !important;
    flex-grow: 1 !important;
    text-align: left !important;
}

.kontakt-trigger-emoji {
    font-size: 16px;
}

/* Profile Pictures in Trigger Button */
.kontakt-trigger-profiles {
    display: flex !important;
    align-items: center !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 2 !important;
}

.kontakt-trigger-profile {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
    margin-left: -15px !important;
    object-fit: cover !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.kontakt-trigger-profile:first-child {
    margin-left: 0 !important;
}


.kontakt-trigger-profile-fallback {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
    margin-left: -15px !important;
    background: #e5e7eb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.kontakt-trigger-profile-fallback:first-child {
    margin-left: 0 !important;
}


/* Menu Items */
.kontakt-menu-items {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.kontakt-menu-item {
    display: flex;
    align-items: center;
    padding: 7px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.0);
    min-height: 50px;
    box-sizing: border-box;
}


.kontakt-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px solid #E4E4E4;
    color: #000;
}

.kontakt-menu-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    text-align: center;
    color: #D2B48C;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.kontakt-menu-icon i {
    font-size: 20px;
    color: inherit;
    line-height: 1;
}

.kontakt-menu-text {
    color: #333;
    font-weight: 400;
    font-size: 16px;
}

/* Popup Container */
.kontakt-popup-container {
    position: fixed;
    width: 300px;
    background: transparent;
    z-index: 999999;
    display: none;
    padding: 0px;
    box-sizing: border-box;
    margin: 20px;
}

/* Popup Video */
.kontakt-popup-video {
    width: 300px;
    height: 350px;
    background: #000;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    margin-bottom: 0;
    flex-shrink: 0; /* Video skal ikke krympe */
}

.kontakt-popup-video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

/* Popup Container Positions */
.kontakt-popup-container.bottom-right {
    bottom: 0;
    right: 0;
}

.kontakt-popup-container.bottom-left {
    bottom: 0;
    left: 0;
}

.kontakt-popup-container.top-right {
    top: 0;
    right: 0;
}

.kontakt-popup-container.top-left {
    top: 0;
    left: 0;
}

.kontakt-popup-container.show {
    display: block;
}

.kontakt-popup-container.show .kontakt-popup {
    opacity: 1;
}

/* Popup Main */
.kontakt-popup {
    background: linear-gradient(60deg, rgb(226 224 224) 0%, rgb(255 255 255 / 80%) 100%);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5.9px);
    -webkit-backdrop-filter: blur(5.9px);
    border: 1px solid rgba(255, 255, 255, 0.31);
    width: 300px;
    max-height: calc(100vh - 40px); /* Max højde minus margin */
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Popup med video - runde hjørner kun nederst */
.kontakt-popup-container.has-video .kontakt-popup {
    border-radius: 0 0 16px 16px;
}

/* Popup uden video - runde hjørner alle steder */
.kontakt-popup-container:not(.has-video) .kontakt-popup {
    border-radius: 16px;
}

/* Popup Positions - Fjernet da popup nu er relative til container */

/* Popup Header */
.kontakt-popup-header {
    color: #333;
    padding: 20px 20px 0px 20px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 70px;
    box-sizing: border-box;
    flex-shrink: 0; /* Header skal ikke krympe */
}

.kontakt-popup-title {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.kontakt-popup-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 400;
    opacity: 0.9;
}

.kontakt-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #333;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.kontakt-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Popup Body */
.kontakt-popup-body {
    padding: 10px 20px 10px 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Vigtigt for flexbox scroll */
    max-height: calc(100vh - 420px); /* Skærmhøjde minus video (350px) og header (70px) */
}

/* Scrollbar styling for popup body */
.kontakt-popup-body::-webkit-scrollbar {
    width: 6px;
}

.kontakt-popup-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.kontakt-popup-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.kontakt-popup-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Contact Cards */
.kontakt-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.kontakt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.kontakt-card:last-child {
    margin-bottom: 0;
}

/* Contact Card Header */
.kontakt-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.kontakt-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.kontakt-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kontakt-avatar-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.kontakt-info {
    flex: 1;
    min-width: 0;
}

.kontakt-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
}

.kontakt-title {
    margin: 0;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

/* Contact Bio */
.kontakt-bio {
    margin-bottom: 12px;
}

.kontakt-bio p {
    margin: 0;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.4;
}

/* Contact Actions */
.kontakt-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.kontakt-action {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    background: white;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.kontakt-action:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.kontakt-action-phone {
    color: #38a169;
}

.kontakt-action-phone:hover {
    background: #f0fff4;
    border-color: #9ae6b4;
}

.kontakt-action-email {
    color: #3182ce;
}

.kontakt-action-email:hover {
    background: #ebf8ff;
    border-color: #90cdf4;
}

.kontakt-action-profile {
    color: #805ad5;
}

.kontakt-action-profile:hover {
    background: #faf5ff;
    border-color: #d6bcfa;
}

.kontakt-icon {
    margin-right: 6px;
    font-size: 14px;
}

.kontakt-text {
    font-size: 12px;
}

/* Contact Profile Modal */
.kontakt-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: none;
}

.kontakt-profile-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.kontakt-profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.kontakt-profile-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.kontakt-profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kontakt-profile-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.kontakt-profile-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.kontakt-profile-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.kontakt-profile-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.kontakt-profile-image {
    text-align: center;
    margin-bottom: 20px;
}

.kontakt-profile-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
}

.kontakt-profile-title h3 {
    margin: 0;
    font-size: 16px;
    color: #4a5568;
    font-weight: 500;
}

.kontakt-profile-bio {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.kontakt-profile-bio p {
    margin: 0;
    color: #4a5568;
    line-height: 1.6;
}

.kontakt-profile-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kontakt-profile-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.kontakt-profile-label {
    font-weight: 600;
    color: #2d3748;
    margin-right: 12px;
    min-width: 60px;
}

.kontakt-profile-item a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
}

.kontakt-profile-item a:hover {
    text-decoration: underline;
}


/* Empty State */
.kontakt-empty {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.kontakt-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.kontakt-empty-text {
    font-size: 16px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .kontakt-popup-container.bottom-right {
        bottom: 0;
        right: 0px;
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        padding: 0;
    }
    
    .kontakt-popup-container.bottom-left {
        bottom: 0;
        left: 0px;
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        padding: 0;
    }
    
    .kontakt-popup-container.top-right {
        top: 0;
        right: 0px;
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        padding: 0;
    }
    
    .kontakt-popup-container.top-left {
        top: 0;
        left: 0px;
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        padding: 0;
    }
    
    .kontakt-popup {
        width: 100%;
        max-width: 100%;
    }
    
    /* Popup Video Responsive */
    .kontakt-popup-video {
        width: 100%;
        height: 300px;
    }
    
    /* Popup Responsive */
    .kontakt-popup {
        width: 100%;
    }
    
    /* Popup Body Responsive */
    .kontakt-popup-body {
        max-height: calc(100vh - 370px); /* Skærmhøjde minus video (300px) og header (70px) */
    }
    
    .kontakt-trigger-icon {
        width: calc(100% - 20px) !important;
        max-width: calc(100vw - 40px) !important;
    }
    
    .kontakt-popup-header {
        padding: 20px;
        min-height: 100px;
    }
    
    .kontakt-popup-body {
        padding: 10px 15px 15px 15px;
    }
    
    .kontakt-menu-item {
        padding: 7px;
        min-height: 50px;
    }
}

/* Animation Classes */
.kontakt-popup.slide-up {
    transform: translateY(100px);
}

.kontakt-popup.slide-up.show {
    transform: translateY(0);
}

.kontakt-popup.slide-down {
    transform: translateY(-100px);
}

.kontakt-popup.slide-down.show {
    transform: translateY(0);
}

.kontakt-popup.slide-left {
    transform: translateX(100px);
}

.kontakt-popup.slide-left.show {
    transform: translateX(0);
}

.kontakt-popup.slide-right {
    transform: translateX(-100px);
}

.kontakt-popup.slide-right.show {
    transform: translateX(0);
}

.kontakt-popup.fade-in {
    transform: scale(0.9);
}

.kontakt-popup.fade-in.show {
    transform: scale(1);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .kontakt-popup,
    .kontakt-card,
    .kontakt-action,
    .kontakt-profile-content {
        transition: none;
    }
    
    .kontakt-popup.show {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .kontakt-popup {
        border: 2px solid #000;
    }
    
    .kontakt-card {
        border: 1px solid #000;
    }
    
    .kontakt-action {
        border: 1px solid #000;
    }
}





/* Profile Pictures Section */
.kontakt-profiles {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kontakt-profile-pictures {
    display: flex;
    align-items: center;
    position: relative;
}

.kontakt-profile-picture {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -25px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.kontakt-profile-picture:first-child {
    margin-left: 0;
}

.kontakt-profile-fallback {
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: 600;
    font-size: 18px;
}

.kontakt-profile-text {
    flex: 1;
    text-align: left;
}

.kontakt-profile-title {
    font-size: 18px;
    font-weight: 600;
    margin:0;
    color: #333;
}

.kontakt-profile-subtitle {
    font-size: 14px;
    margin: 0;
    color: #666;
    line-height: 1.4;
    font-weight: 400;
}


.kontakt-online-indicator {
    width: 12px !important;
    height: 12px !important;
    background: #10b981 !important;
    border-radius: 50% !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
    border: 2px solid white !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
}

.kontakt-online-dot {
    width: 12px !important;
    height: 12px !important;
    background: #10b981 !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    border: 2px solid white !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

