/**
 * TTPixel Advance 2 Widget CSS (Container Canvas Edition)
 * Version: 1.0.0
 * Author: TTPixel Expert
 */

/* Main Container Wrapper */
.ttpixel-adv2-card-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

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

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

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

/* Inner Open Content Canvas */
.ttpixel-adv2-canvas {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    flex-direction: var(--ttpixel2-flex-dir, column);
    align-items: var(--ttpixel2-align, flex-start);
    justify-content: var(--ttpixel2-justify, center);
    gap: var(--ttpixel2-gap, 24px);
    padding: var(--ttpixel2-padding, 45px 50px);
    box-sizing: border-box;
}

/* Content Area - Full Width Layout */
.ttpixel-adv2-content-area {
    width: 100%;
    max-width: var(--ttpixel2-content-max-width, 100%);
    box-sizing: border-box;
    z-index: 4;
}

/* Top Header Media (Image / Icon Above Heading) */
.ttpixel-adv2-top-media {
    display: inline-block;
    margin-bottom: 15px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.ttpixel-adv2-top-media img {
    max-width: var(--ttpixel2-top-media-size, 48px);
    height: auto;
    display: block;
}

.ttpixel-adv2-top-media svg,
.ttpixel-adv2-top-media i {
    width: var(--ttpixel2-top-media-size, 48px);
    height: var(--ttpixel2-top-media-size, 48px);
    font-size: var(--ttpixel2-top-media-size, 48px);
    line-height: 1;
    fill: currentColor;
    color: currentColor;
    display: inline-block;
}

/* Heading & Subtitle Typography */
.ttpixel-adv2-heading {
    margin: 0 0 12px 0;
    padding: 0;
    font-size: var(--ttpixel2-title-size, 38px);
    font-weight: var(--ttpixel2-title-weight, 700);
    line-height: var(--ttpixel2-title-line-height, 1.2);
    color: var(--ttpixel2-title-color, #ffffff);
    word-break: break-word;
    width: 100%;
}

.ttpixel-adv2-subtitle {
    margin: 0;
    padding: 0;
    font-size: var(--ttpixel2-sub-size, 16px);
    font-weight: var(--ttpixel2-sub-weight, 400);
    line-height: var(--ttpixel2-sub-line-height, 1.5);
    color: var(--ttpixel2-sub-color, rgba(255, 255, 255, 0.9));
    word-break: break-word;
    width: 100%;
}

.ttpixel-adv2-custom-body {
    margin-top: 15px;
    width: 100%;
}

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

.ttpixel-adv2-flare::before,
.ttpixel-adv2-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-adv2-flare::before { width: 100%; height: 3px; }
.ttpixel-adv2-flare::after { width: 3px; height: 100%; }

@keyframes ttpixel2PulseFlare {
    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-adv2-action-wrapper {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--ttpixel2-notch-gap, 14px);
    box-sizing: border-box;
}

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

.ttpixel-adv2-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-adv2-notch-label.label-outside {
    position: relative;
    z-index: 11;
    font-size: var(--ttpixel2-label-size, 15px);
    font-weight: var(--ttpixel2-label-weight, 600);
    color: var(--ttpixel2-label-color, #ffffff);
    text-decoration: none !important;
    white-space: nowrap;
    transition: color 0.3s ease, transform 0.3s ease;
    padding: 0 4px;
}

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

/* Notch Container (Cutout Badge) */
.ttpixel-adv2-notch-container {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--ttpixel2-notch-gap, 12px);
    padding: var(--ttpixel2-notch-padding, 8px 10px 8px 10px);
    background-color: var(--ttpixel2-notch-bg, #ffffff);
    border-top-left-radius: var(--ttpixel2-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 (When label is placed inside the white notch container) */
.ttpixel-adv2-notch-label.label-inside {
    font-size: var(--ttpixel2-label-size, 15px);
    font-weight: var(--ttpixel2-label-weight, 600);
    color: var(--ttpixel2-label-color, #1e293b);
    text-decoration: none !important;
    white-space: nowrap;
    transition: color 0.3s ease;
    padding-left: 12px;
}

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

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

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

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

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

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

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

/* ==========================================================
   ACTION BUTTON WITH CUSTOMIZABLE HOVER ROTATION ANIMATIONS
   ========================================================== */
.ttpixel-adv2-notch-btn {
    position: relative;
    z-index: 5;
    overflow: hidden;
    width: var(--ttpixel2-btn-size, 46px);
    height: var(--ttpixel2-btn-size, 46px);
    border-radius: 50%;
    background-color: var(--ttpixel2-btn-bg, #0088eb);
    color: var(--ttpixel2-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-adv2-notch-btn svg,
.ttpixel-adv2-notch-btn i,
.ttpixel-adv2-notch-btn i::before,
.ttpixel-adv2-notch-btn span {
    width: var(--ttpixel2-btn-icon-size, 18px);
    height: var(--ttpixel2-btn-icon-size, 18px);
    font-size: var(--ttpixel2-btn-icon-size, 18px);
    line-height: 1;
    fill: currentColor;
    color: currentColor;
    display: inline-block;
    transform-origin: center center;
    transition: transform var(--ttpixel2-rotate-speed, 0.4s) cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

/* Hover State for Button Container */
.ttpixel-adv2-action-wrapper:hover .ttpixel-adv2-notch-btn,
.ttpixel-adv2-notch-btn:hover {
    background-color: var(--ttpixel2-btn-hover-bg, #0074ca);
    color: var(--ttpixel2-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-adv2-card.has-icon-rotate.rotate-360 .ttpixel-adv2-action-wrapper:hover .ttpixel-adv2-notch-btn svg,
.ttpixel-adv2-card.has-icon-rotate.rotate-360 .ttpixel-adv2-action-wrapper:hover .ttpixel-adv2-notch-btn i,
.ttpixel-adv2-card.has-icon-rotate.rotate-360 .ttpixel-adv2-notch-btn:hover svg,
.ttpixel-adv2-card.has-icon-rotate.rotate-360 .ttpixel-adv2-notch-btn:hover i {
    transform: rotate(var(--ttpixel2-rotate-deg, 360deg)) scale(1.15);
}

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

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

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

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

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

@keyframes ttpixel2BounceRotate {
    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); }
}

/* Responsive Rules */
@media (max-width: 767px) {
    .ttpixel-adv2-canvas {
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 20px 70px 20px;
    }
    .ttpixel-adv2-notch-container {
        padding: 6px 8px 6px 8px;
    }
    .ttpixel-adv2-notch-btn {
        width: 40px;
        height: 40px;
    }
}
