/**
 * TTPixel Advance Widget CSS
 * Version: 1.0.0
 * Author: TTPixel Expert
 */

/* Main Card Container */
.ttpixel-adv-card-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.ttpixel-adv-card {
    position: relative;
    width: 100%;
    min-height: 280px;
    border-radius: var(--ttpixel-card-radius, 28px);
    background-color: var(--ttpixel-card-bg, #d81b60);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 45px 50px;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.35s ease;
}

/* Background Grid Pattern */
.ttpixel-adv-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: var(--ttpixel-grid-opacity, 0.18);
    background-size: var(--ttpixel-grid-size, 24px) var(--ttpixel-grid-size, 24px);
    background-image: 
        linear-gradient(to right, var(--ttpixel-grid-color, rgba(255, 255, 255, 0.5)) 1px, transparent 1px),
        linear-gradient(to bottom, var(--ttpixel-grid-color, rgba(255, 255, 255, 0.5)) 1px, transparent 1px);
}

/* Color / Gradient Overlay */
.ttpixel-adv-color-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: var(--ttpixel-overlay-bg, transparent);
    opacity: var(--ttpixel-overlay-opacity, 1);
    mix-blend-mode: var(--ttpixel-overlay-blend, normal);
}

/* Main Inner Layout Grid */
.ttpixel-adv-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Left Content Area */
.ttpixel-adv-content-left {
    flex: 1 1 50%;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 4;
}

.ttpixel-adv-title {
    margin: 0 0 16px 0;
    padding: 0;
    font-size: var(--ttpixel-title-size, 44px);
    font-weight: var(--ttpixel-title-weight, 700);
    line-height: var(--ttpixel-title-line-height, 1.15);
    color: var(--ttpixel-title-color, #ffffff);
    letter-spacing: -0.5px;
    word-break: break-word;
    transition: color 0.3s ease;
}

.ttpixel-adv-subtitle {
    margin: 0;
    padding: 0;
    font-size: var(--ttpixel-sub-size, 18px);
    font-weight: var(--ttpixel-sub-weight, 500);
    line-height: var(--ttpixel-sub-line-height, 1.4);
    color: var(--ttpixel-sub-color, rgba(255, 255, 255, 0.92));
    word-break: break-word;
    transition: color 0.3s ease;
}

/* Right Media Area */
.ttpixel-adv-media-right {
    flex: 1 1 45%;
    max-width: 48%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}

.ttpixel-adv-img-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.ttpixel-adv-img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.12));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.ttpixel-adv-card:hover .ttpixel-adv-img.has-hover-float {
    transform: translateY(-8px) scale(1.02);
    filter: drop-shadow(0 22px 35px rgba(0, 0, 0, 0.18));
}

/* Star / Flare Light Effect Accent */
.ttpixel-adv-flare {
    position: absolute;
    right: var(--ttpixel-flare-right, -10px);
    top: var(--ttpixel-flare-top, 50%);
    transform: translateY(-50%);
    width: var(--ttpixel-flare-size, 80px);
    height: var(--ttpixel-flare-size, 80px);
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.6) 20%, rgba(255, 255, 255, 0) 70%);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
    animation: ttpixelPulseFlare 3s infinite alternate ease-in-out;
}

.ttpixel-adv-flare::before,
.ttpixel-adv-flare::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 255, 255, 1);
}

.ttpixel-adv-flare::before {
    width: 100%;
    height: 3px;
}

.ttpixel-adv-flare::after {
    width: 3px;
    height: 100%;
}

@keyframes ttpixelPulseFlare {
    0% { transform: translateY(-50%) scale(0.85); opacity: 0.7; }
    100% { transform: translateY(-50%) scale(1.15); opacity: 1; }
}

/* ==========================================================
   ACTION NOTCH WRAPPER & OUTSIDE / INSIDE LABEL POSITIONING
   ========================================================== */
.ttpixel-adv-action-wrapper {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--ttpixel-notch-gap, 14px);
    box-sizing: border-box;
}

.ttpixel-adv-action-wrapper.notch-pos-bottom-right {
    right: 0;
    bottom: 0;
    left: auto;
    flex-direction: row;
}

.ttpixel-adv-action-wrapper.notch-pos-bottom-left {
    left: 0;
    bottom: 0;
    right: auto;
    flex-direction: row-reverse;
}

/* Outside Label (Positioned on the main Card Background) */
.ttpixel-adv-notch-label.label-outside {
    position: relative;
    z-index: 11;
    font-size: var(--ttpixel-label-size, 15px);
    font-weight: var(--ttpixel-label-weight, 600);
    color: var(--ttpixel-label-color, #ffffff);
    text-decoration: none !important;
    white-space: nowrap;
    transition: color 0.3s ease, transform 0.3s ease;
    padding: 0 4px;
}

.ttpixel-adv-notch-label.label-outside:hover,
.ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-label.label-outside {
    color: var(--ttpixel-label-hover-color, #ffffff);
}

/* Notch Container (Cutout Badge) */
.ttpixel-adv-notch-container {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--ttpixel-notch-gap, 12px);
    padding: var(--ttpixel-notch-padding, 8px 10px 8px 10px);
    background-color: var(--ttpixel-notch-bg, #ffffff);
    border-top-left-radius: var(--ttpixel-notch-curve, 26px);
    box-sizing: border-box;
    box-shadow: -4px -4px 15px rgba(0, 0, 0, 0.03);
    transition: background-color 0.3s ease, border-radius 0.3s ease;
}

/* Inside Label */
.ttpixel-adv-notch-label.label-inside {
    font-size: var(--ttpixel-label-size, 15px);
    font-weight: var(--ttpixel-label-weight, 600);
    color: var(--ttpixel-label-color, #1e293b);
    text-decoration: none !important;
    white-space: nowrap;
    transition: color 0.3s ease;
    padding-left: 12px;
}

.ttpixel-adv-notch-label.label-inside:hover,
.ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-label.label-inside {
    color: var(--ttpixel-label-hover-color, #0088eb);
}

/* Adjust padding when label is inside */
.ttpixel-adv-card.label-pos-inside .ttpixel-adv-notch-container {
    padding: var(--ttpixel-notch-padding, 8px 10px 8px 24px);
}

/* Inverted Corner Transition Fillet - Top Right Fillet */
.ttpixel-adv-notch-container::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: calc(var(--ttpixel-notch-curve, 26px) * -1);
    right: 0;
    width: var(--ttpixel-notch-curve, 26px);
    height: var(--ttpixel-notch-curve, 26px);
    background: transparent;
    border-bottom-right-radius: var(--ttpixel-notch-curve, 26px);
    box-shadow: 10px 10px 0 10px var(--ttpixel-notch-bg, #ffffff);
    pointer-events: none;
    transition: box-shadow 0.3s ease;
}

/* Inverted Corner Transition Fillet - Bottom Left Fillet */
.ttpixel-adv-notch-container::after {
    content: "";
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: calc(var(--ttpixel-notch-curve, 26px) * -1);
    width: var(--ttpixel-notch-curve, 26px);
    height: var(--ttpixel-notch-curve, 26px);
    background: transparent;
    border-bottom-right-radius: var(--ttpixel-notch-curve, 26px);
    box-shadow: 10px 10px 0 10px var(--ttpixel-notch-bg, #ffffff);
    pointer-events: none;
    transition: box-shadow 0.3s ease;
}

/* Bottom-Left Position Variant */
.ttpixel-adv-card.notch-pos-bottom-left .ttpixel-adv-notch-container {
    border-top-left-radius: 0;
    border-top-right-radius: var(--ttpixel-notch-curve, 26px);
    box-shadow: 4px -4px 15px rgba(0, 0, 0, 0.03);
}

.ttpixel-adv-card.notch-pos-bottom-left .ttpixel-adv-notch-container::before {
    right: auto;
    left: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: var(--ttpixel-notch-curve, 26px);
    box-shadow: -10px 10px 0 10px var(--ttpixel-notch-bg, #ffffff);
}

.ttpixel-adv-card.notch-pos-bottom-left .ttpixel-adv-notch-container::after {
    left: auto;
    right: calc(var(--ttpixel-notch-curve, 26px) * -1);
    border-bottom-right-radius: 0;
    border-bottom-left-radius: var(--ttpixel-notch-curve, 26px);
    box-shadow: -10px 10px 0 10px var(--ttpixel-notch-bg, #ffffff);
}

/* ==========================================================
   ACTION BUTTON WITH CUSTOMIZABLE HOVER ROTATION ANIMATIONS
   ========================================================== */
.ttpixel-adv-notch-btn {
    position: relative;
    z-index: 5;
    overflow: hidden;
    width: var(--ttpixel-btn-size, 46px);
    height: var(--ttpixel-btn-size, 46px);
    border-radius: 50%;
    background-color: var(--ttpixel-btn-bg, #0088eb);
    color: var(--ttpixel-btn-color, #ffffff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    outline: none;
    box-shadow: 0 6px 16px rgba(0, 136, 235, 0.3);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.ttpixel-adv-notch-btn svg,
.ttpixel-adv-notch-btn i,
.ttpixel-adv-notch-btn i::before,
.ttpixel-adv-notch-btn span {
    width: var(--ttpixel-btn-icon-size, 18px);
    height: var(--ttpixel-btn-icon-size, 18px);
    font-size: var(--ttpixel-btn-icon-size, 18px);
    line-height: 1;
    fill: currentColor;
    color: currentColor;
    display: inline-block;
    transform-origin: center center;
    transition: transform var(--ttpixel-rotate-speed, 0.4s) cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

/* Hover State for Button Container */
.ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn,
.ttpixel-adv-notch-btn:hover {
    background-color: var(--ttpixel-btn-hover-bg, #0074ca);
    color: var(--ttpixel-btn-hover-color, #ffffff);
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(0, 136, 235, 0.45);
}

/* 1. Default / 360° Smooth Hover Rotation */
.ttpixel-adv-card.has-icon-rotate.rotate-360 .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn svg,
.ttpixel-adv-card.has-icon-rotate.rotate-360 .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn i,
.ttpixel-adv-card.has-icon-rotate.rotate-360 .ttpixel-adv-notch-btn:hover svg,
.ttpixel-adv-card.has-icon-rotate.rotate-360 .ttpixel-adv-notch-btn:hover i {
    transform: rotate(var(--ttpixel-rotate-deg, 360deg)) scale(1.15);
}

/* 2. 90° Quarter Rotation */
.ttpixel-adv-card.has-icon-rotate.rotate-90 .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn svg,
.ttpixel-adv-card.has-icon-rotate.rotate-90 .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn i,
.ttpixel-adv-card.has-icon-rotate.rotate-90 .ttpixel-adv-notch-btn:hover svg,
.ttpixel-adv-card.has-icon-rotate.rotate-90 .ttpixel-adv-notch-btn:hover i {
    transform: rotate(90deg) scale(1.15);
}

/* 3. 180° Half Rotation */
.ttpixel-adv-card.has-icon-rotate.rotate-180 .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn svg,
.ttpixel-adv-card.has-icon-rotate.rotate-180 .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn i,
.ttpixel-adv-card.has-icon-rotate.rotate-180 .ttpixel-adv-notch-btn:hover svg,
.ttpixel-adv-card.has-icon-rotate.rotate-180 .ttpixel-adv-notch-btn:hover i {
    transform: rotate(180deg) scale(1.15);
}

/* 4. Continuous Infinite Spin on Hover */
.ttpixel-adv-card.has-icon-rotate.rotate-spin .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn svg,
.ttpixel-adv-card.has-icon-rotate.rotate-spin .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn i,
.ttpixel-adv-card.has-icon-rotate.rotate-spin .ttpixel-adv-notch-btn:hover svg,
.ttpixel-adv-card.has-icon-rotate.rotate-spin .ttpixel-adv-notch-btn:hover i {
    animation: ttpixelInfiniteSpin var(--ttpixel-rotate-speed, 0.8s) linear infinite;
}

@keyframes ttpixelInfiniteSpin {
    from { transform: rotate(0deg) scale(1.15); }
    to { transform: rotate(360deg) scale(1.15); }
}

/* 5. Rotate & Elastic Bounce */
.ttpixel-adv-card.has-icon-rotate.rotate-bounce .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn svg,
.ttpixel-adv-card.has-icon-rotate.rotate-bounce .ttpixel-adv-action-wrapper:hover .ttpixel-adv-notch-btn i,
.ttpixel-adv-card.has-icon-rotate.rotate-bounce .ttpixel-adv-notch-btn:hover svg,
.ttpixel-adv-card.has-icon-rotate.rotate-bounce .ttpixel-adv-notch-btn:hover i {
    animation: ttpixelBounceRotate var(--ttpixel-rotate-speed, 0.6s) ease-in-out;
}

@keyframes ttpixelBounceRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.3); }
    75% { transform: rotate(380deg) scale(0.95); }
    100% { transform: rotate(360deg) scale(1.15); }
}

/* Ripple Animation */
.ttpixel-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ttpixelRipple 0.6s linear;
    pointer-events: none;
}

@keyframes ttpixelRipple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Responsive Rules */
@media (max-width: 991px) {
    .ttpixel-adv-card {
        padding: 35px 35px;
        min-height: 240px;
    }
    .ttpixel-adv-title {
        font-size: var(--ttpixel-title-size-tablet, 34px);
    }
    .ttpixel-adv-subtitle {
        font-size: var(--ttpixel-sub-size-tablet, 16px);
    }
}

@media (max-width: 767px) {
    .ttpixel-adv-card {
        padding: 30px 24px 75px 24px;
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
        border-radius: var(--ttpixel-card-radius-mobile, 20px);
    }
    .ttpixel-adv-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
    }
    .ttpixel-adv-content-left {
        max-width: 100%;
    }
    .ttpixel-adv-media-right {
        max-width: 100%;
        width: 100%;
        justify-content: center;
    }
    .ttpixel-adv-title {
        font-size: var(--ttpixel-title-size-mobile, 26px);
    }
    .ttpixel-adv-subtitle {
        font-size: var(--ttpixel-sub-size-mobile, 14px);
    }
    .ttpixel-adv-notch-container {
        padding: 6px 8px 6px 16px;
    }
    .ttpixel-adv-notch-btn {
        width: 40px;
        height: 40px;
    }
    .ttpixel-adv-notch-label {
        font-size: 13px;
    }
}
