/* ==========================================================================
   Hair Reveal Widget - CSS
   Modern Before/After with Organic Blob Reveal Effect
   ========================================================================== */

/* CSS Variables */
:root {
    --hr-glow-1: #667eea;
    --hr-glow-2: #764ba2;
    --hr-particle: #ffffff;
}

/* ==========================================================================
   Widget Container
   ========================================================================== */
.hr-widget {
    position: relative;
    width: 100%;
}

.hr-container {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 24px;
    overflow: hidden;
    cursor: none;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Image Layers
   ========================================================================== */
.hr-image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hr-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.hr-before-layer {
    z-index: 1;
}

.hr-before-layer .hr-image,
.hr-after-layer .hr-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.hr-after-layer {
    z-index: 2;
    pointer-events: none;
    /* Clip-path will be set by JavaScript */
    clip-path: circle(0px at 50% 50%);
    transition: clip-path 0.1s ease-out;
}

/* ==========================================================================
   Reveal Blob
   ========================================================================== */
.hr-reveal-blob {
    position: absolute;
    width: var(--blob-size, 280px);
    height: var(--blob-size, 280px);
    pointer-events: none;
    z-index: 10;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, left, top;
}

.hr-container:hover .hr-reveal-blob {
    transform: translate(-50%, -50%) scale(1);
}

/* Blob Inner Container */
.hr-blob-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Blob Shapes */
.hr-blob-inner[data-shape="blob"] {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

.hr-blob-inner[data-shape="cloud"] {
    border-radius: 50% 50% 45% 55% / 40% 60% 40% 60%;
}

.hr-blob-inner[data-shape="circle"] {
    border-radius: 50%;
}

/* Blob Animation */
.hr-blob-inner.hr-animate {
    animation: blobMorph 8s ease-in-out infinite;
}

@keyframes blobMorph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 40% 70% 50%;
    }
    75% {
        border-radius: 40% 60% 60% 40% / 60% 40% 50% 50%;
    }
}

/* Blob Content (Visual Center) */
.hr-blob-content {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: inherit;
    background: transparent;
}

/* ==========================================================================
   Glow Rings
   ========================================================================== */
.hr-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hr-container:hover .hr-glow-ring {
    opacity: 1;
}

.hr-glow-ring-1 {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--glow-color-1), var(--glow-color-2));
    filter: blur(20px);
    opacity: 0.6;
    animation: glowPulse1 2s ease-in-out infinite;
}

.hr-glow-ring-2 {
    width: 120%;
    height: 120%;
    background: linear-gradient(135deg, var(--glow-color-2), var(--glow-color-1));
    filter: blur(40px);
    opacity: 0.4;
    animation: glowPulse2 2.5s ease-in-out infinite;
}

.hr-glow-ring-3 {
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, var(--glow-color-1) 0%, transparent 70%);
    filter: blur(60px);
    opacity: 0.3;
    animation: glowPulse3 3s ease-in-out infinite;
}

@keyframes glowPulse1 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

@keyframes glowPulse2 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.5; }
}

@keyframes glowPulse3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.4; }
}

/* Blob Border Glow */
.hr-blob-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    border: 3px solid transparent;
    background: linear-gradient(135deg, var(--glow-color-1), var(--glow-color-2)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 4s linear infinite;
}

@keyframes borderRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ==========================================================================
   Particles
   ========================================================================== */
.hr-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hr-container:hover .hr-particles {
    opacity: 1;
}

.hr-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--particle-color);
    border-radius: 50%;
    opacity: 0;
    animation: particleFly 2s ease-out infinite;
    animation-delay: var(--delay);
    box-shadow: 0 0 10px var(--particle-color), 0 0 20px var(--particle-color);
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-150px) scale(0);
    }
}

/* Extra floating particles */
.hr-particle:nth-child(odd) {
    width: 4px;
    height: 4px;
    animation-duration: 2.5s;
}

.hr-particle:nth-child(3n) {
    width: 8px;
    height: 8px;
    animation-duration: 1.8s;
}

/* ==========================================================================
   Labels
   ========================================================================== */
.hr-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    border-radius: 50px;
    z-index: 20;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hr-label-before {
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hr-label-after {
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transform: translateY(10px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.hr-container:hover .hr-label-after {
    opacity: 1;
    transform: translateY(0);
}

.hr-label-dot {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

.hr-label-dot-pulse {
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

/* ==========================================================================
   Hover Hint
   ========================================================================== */
.hr-hint {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    z-index: 15;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.hr-container:hover .hr-hint {
    opacity: 0;
    transform: translate(-50%, 50%) scale(0.9);
}

.hr-hint-icon {
    width: 24px;
    height: 24px;
    animation: hintBounce 1.5s ease-in-out infinite;
}

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

.hr-hint-cursor {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.6);
    animation: cursorMove 2s ease-in-out infinite;
}

@keyframes cursorMove {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(15px, -10px); }
    50% { transform: translate(-10px, 15px); }
    75% { transform: translate(10px, 10px); }
}

/* ==========================================================================
   Statistics
   ========================================================================== */
.hr-stats {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    z-index: 20;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    transition-delay: 0.1s;
}

.hr-container:hover .hr-stats {
    transform: translateY(0);
    opacity: 1;
}

.hr-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hr-stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 10px;
    color: #667eea;
}

.hr-stat-icon svg {
    width: 20px;
    height: 20px;
}

.hr-stat-content {
    display: flex;
    flex-direction: column;
}

.hr-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.hr-stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hr-stat-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, #e0e0e0, transparent);
}

/* ==========================================================================
   Corner Decorations
   ========================================================================== */
.hr-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 5;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.hr-corner-tl {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.hr-corner-tr {
    top: 12px;
    right: 12px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.hr-corner-bl {
    bottom: 12px;
    left: 12px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.hr-corner-br {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.hr-container:hover .hr-corner {
    border-color: rgba(102, 126, 234, 0.5);
}

.hr-container:hover .hr-corner-tl {
    transform: translate(-4px, -4px);
}

.hr-container:hover .hr-corner-tr {
    transform: translate(4px, -4px);
}

.hr-container:hover .hr-corner-bl {
    transform: translate(-4px, 4px);
}

.hr-container:hover .hr-corner-br {
    transform: translate(4px, 4px);
}

/* ==========================================================================
   SVG Definitions (Hidden)
   ========================================================================== */
.hr-blob-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .hr-container {
        height: 400px;
    }
    
    .hr-reveal-blob {
        --blob-size: 200px !important;
    }
    
    .hr-stats {
        top: auto;
        bottom: 70px;
        right: 50%;
        transform: translateX(50%) translateY(10px);
        padding: 10px 16px;
        gap: 12px;
    }
    
    .hr-container:hover .hr-stats {
        transform: translateX(50%) translateY(0);
    }
    
    .hr-stat-value {
        font-size: 16px;
    }
    
    .hr-label {
        font-size: 11px;
        padding: 8px 14px;
    }
    
    .hr-hint {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hr-container {
        height: 350px;
        border-radius: 16px;
    }
    
    .hr-reveal-blob {
        --blob-size: 160px !important;
    }
    
    .hr-stats {
        gap: 8px;
        padding: 8px 12px;
    }
    
    .hr-stat-icon {
        width: 28px;
        height: 28px;
    }
    
    .hr-stat-value {
        font-size: 14px;
    }
    
    .hr-corner {
        width: 24px;
        height: 24px;
    }
}

/* ==========================================================================
   Touch Devices
   ========================================================================== */
@media (hover: none) {
    .hr-container {
        cursor: pointer;
    }
    
    .hr-hint span {
        display: none;
    }
    
    .hr-hint::after {
        content: 'Tik om resultaat te zien';
    }
    
    .hr-reveal-blob {
        top: 50% !important;
        left: 50% !important;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .hr-blob-inner.hr-animate,
    .hr-glow-ring,
    .hr-particle,
    .hr-blob-border,
    .hr-label-dot-pulse,
    .hr-hint-icon,
    .hr-hint-cursor {
        animation: none !important;
    }
    
    .hr-reveal-blob,
    .hr-label,
    .hr-stats,
    .hr-corner,
    .hr-hint {
        transition: none !important;
    }
}

/* ==========================================================================
   Elementor Editor
   ========================================================================== */
.elementor-editor-active .hr-reveal-blob {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.7;
}

.elementor-editor-active .hr-hint {
    display: none;
}

.elementor-editor-active .hr-stats,
.elementor-editor-active .hr-label-after {
    opacity: 1;
    transform: none;
}
