/* Capsule Hero Animation Widget */
.serenity-capsule-hero-animation {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.serenity-capsule-hero-animation .arch-animation-wrapper {
    position: relative;
    height: 100vh; /* Fixed height for sticky animation */
    width: 100%;
}

.serenity-capsule-hero-animation .arch-sticky-container {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background: var(--background-color, #f5f5dc);
}

.serenity-capsule-hero-animation .text-container {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    width: 100%;
    max-width: 90%;
    padding: 0 20px;
    transition: all 0.3s ease;
}

.serenity-capsule-hero-animation .animated-text {
    font-size: clamp(1.8rem, 6vw, 5rem);
    font-weight: bold;
    color: var(--text-initial-color, #000);
    margin: 0 0 15px 0;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.serenity-capsule-hero-animation .animated-subtext {
    font-size: clamp(0.9rem, 2vw, 1.5rem);
    color: var(--text-initial-color, #000);
    margin: 0 0 25px 0;
    font-weight: 300;
    transition: color 0.3s ease;
}

.serenity-capsule-hero-animation .animated-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    font-weight: 600;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
    position: relative;
    
    /* Chrome metal background - same gradient as chrome metal button */
    background: linear-gradient(105deg, 
        rgba(57,56,56,1) 4%, 
        rgba(254,227,216,1) 8%, 
        rgba(239,240,243,1) 10%, 
        rgba(255,255,229,1) 13%, 
        rgba(254,192,171,1) 17%, 
        rgba(86,87,89,1) 23%, 
        rgba(86,87,89,1) 35%, 
        rgba(194,169,138,1) 39%, 
        rgba(184,184,184,1) 43%, 
        rgba(184,184,184,1) 53%, 
        rgba(229,255,254,1) 58%, 
        rgba(239,240,243,1) 60%, 
        rgba(255,247,234,1) 67%, 
        rgba(249,232,225,1) 69%, 
        rgba(180,178,181,1) 75%, 
        rgba(208,216,248,1) 78%, 
        rgba(89,81,87,1) 82%, 
        rgba(89,81,87,1) 87%, 
        rgba(203,207,219,1) 89%, 
        rgba(89,81,87,1) 92%, 
        rgba(57,56,56,1) 96%
    );
    
    background-size: 200% 100%;
    background-repeat: repeat-x;
    background-position: 100% 100%;
    
    color: rgba(97, 99, 106, 1) !important;
    text-shadow: 0 1px rgba(255, 255, 255, .9), 0 -1px rgba(30, 30, 30, 1);
    
    border-top: 1px solid rgba(238, 238, 220, 0.9);
    border-right: 1px solid rgba(40, 40, 40, 0.8);
    border-bottom: 1px solid rgba(40, 40, 40, 0.9);
    border-left: 1px solid rgba(91, 107, 128, 0.7);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
    
    transition: all 350ms ease;
}

/* Inner grey reflection layer behind text */
.serenity-capsule-hero-animation .animated-cta::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: linear-gradient(to bottom, #f0f0f0 0%, #d0d0d0 100%);
    border-radius: 5px;
    z-index: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -1px 0 rgba(255,255,255,0.3);
    pointer-events: none;
}

/* Text above grey layer */
.serenity-capsule-hero-animation .animated-cta span {
    position: relative;
    z-index: 2;
    display: block;
}

.serenity-capsule-hero-animation .animated-cta:hover {
    background-position: 0% 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.serenity-capsule-hero-animation .text-container.white .animated-text {
    color: var(--text-white-color, #fff);
}

.serenity-capsule-hero-animation .text-container.white .animated-subtext {
    color: var(--text-white-color, #fff);
}

/* Button stays chrome metal - never changes with white class */
.serenity-capsule-hero-animation .text-container.white .animated-cta {
    /* Keep all chrome metal styles intact */
}

.serenity-capsule-hero-animation .text-container.white .animated-cta span {
    /* Keep text color as chrome metal gray */
    color: rgba(97, 99, 106, 1) !important;
}

.serenity-capsule-hero-animation .text-container.white .animated-cta:hover {
    /* Keep hover animation, no color change */
}

.serenity-capsule-hero-animation .capsule-shape {
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px; /* Default - will be overridden by Elementor responsive controls */
    height: 120px; /* Default - will be overridden by Elementor responsive controls */
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    z-index: 1;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.serenity-capsule-hero-animation .capsule-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 2;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.serenity-capsule-hero-animation .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    pointer-events: none;
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .serenity-capsule-hero-animation .arch-animation-wrapper {
        height: 100vh; /* Fixed height for sticky animation */
    }
    
    .serenity-capsule-hero-animation .arch-sticky-container {
        height: 100vh;
        min-height: 100vh;
    }
    
    .serenity-capsule-hero-animation .text-container {
        top: 30%;
        max-width: 95%;
        padding: 0 15px;
    }
    
    .serenity-capsule-hero-animation .animated-text {
        margin: 0 0 10px 0;
    }
    
    .serenity-capsule-hero-animation .animated-subtext {
        margin: 0 0 20px 0;
    }
    
    .serenity-capsule-hero-animation .animated-cta {
        padding: 10px 25px;
    }
    
    .serenity-capsule-hero-animation .capsule-shape {
        width: 40px; /* Default - will be overridden by Elementor responsive controls */
        height: 70px; /* Default - will be overridden by Elementor responsive controls */
        border-radius: 20px 20px 0 0;
    }
}

@media (max-width: 480px) {
    .serenity-capsule-hero-animation .arch-animation-wrapper {
        height: 100vh; /* Fixed height for sticky animation */
    }
    
    .serenity-capsule-hero-animation .arch-sticky-container {
        height: 100vh;
        min-height: 100vh;
    }
    
    .serenity-capsule-hero-animation .text-container {
        top: 35%;
    }
    
    .serenity-capsule-hero-animation .animated-cta {
        padding: 10px 20px;
    }
    
    .serenity-capsule-hero-animation .capsule-shape {
        width: 35px; /* Default - will be overridden by Elementor responsive controls */
        height: 60px; /* Default - will be overridden by Elementor responsive controls */
        border-radius: 17.5px 17.5px 0 0;
    }
}

/* Elementor Editor Compatibility */
.elementor-editor-active .serenity-capsule-hero-animation .arch-animation-wrapper {
    height: 100vh;
}

.elementor-editor-active .serenity-capsule-hero-animation .arch-sticky-container {
    position: relative;
}

/* Ensure widget works in editor preview */
.elementor-element-edit-mode .serenity-capsule-hero-animation {
    min-height: 500px;
}

.elementor-element-edit-mode .serenity-capsule-hero-animation .capsule-shape {
    width: 40px !important;
    height: 120px !important;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    z-index: 1;
}

.elementor-element-edit-mode .serenity-capsule-hero-animation .capsule-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.elementor-element-edit-mode .serenity-capsule-hero-animation .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.elementor-element-edit-mode .serenity-capsule-hero-animation .text-container {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    width: 100%;
    max-width: 90%;
    padding: 0 20px;
}

/* Ensure controls are visible in editor */
.elementor-editor-active .serenity-capsule-hero-animation .animated-text,
.elementor-editor-active .serenity-capsule-hero-animation .animated-subtext,
.elementor-editor-active .serenity-capsule-hero-animation .animated-cta {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .serenity-capsule-hero-animation * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
