/* Reset and Variables */
:root {
    --llpp-primary: #2563eb;
    --llpp-secondary: #475569;
    --llpp-success: #22c55e;
    --llpp-white: #ffffff;
    --llpp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --llpp-radius: 12px;
}

/* Floating Button */
#llpp-floating-button {
    position: fixed;
    bottom: 30px;
    z-index: 9999;
}

#llpp-floating-button.llpp-float-right { right: 30px; }
#llpp-floating-button.llpp-float-left { left: 30px; }

#llpp-trigger {
    background: var(--llpp-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: var(--llpp-shadow);
    transition: transform 0.3s ease;
}

#llpp-trigger:hover {
    transform: scale(1.05);
}

.llpp-button-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--llpp-primary);
    border-radius: 50px;
    opacity: 0.6;
    animation: llpp-pulse 2s infinite;
    z-index: -1;
}

@keyframes llpp-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Modal Overlay */
.llpp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.llpp-overlay.llpp-select-active {
    align-items: flex-start;
}

.llpp-overlay.llpp-select-active .llpp-modal {
    overflow: visible;
}

.llpp-modal {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: var(--llpp-radius);
    position: relative;
    padding: 40px;
    box-shadow: var(--llpp-shadow);
    animation: llpp-slide-up 0.4s ease-out;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes llpp-slide-up {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.llpp-close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

/* Form Styles */
.llpp-modal-content h3 { margin-top: 0; margin-bottom: 10px; font-size: 24px; color: #1e293b; }
.llpp-modal-content p { color: #64748b; margin-bottom: 30px; }

.llpp-form-group { margin-bottom: 15px; }
.llpp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.llpp-form-group input, 
.llpp-form-group select, 
.llpp-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    color: #333 !important;
    background: #fff !important;
}

.llpp-form-group input:focus { border-color: var(--llpp-primary); outline: none; }

.llpp-form-group textarea { height: 100px; resize: none; }

.llpp-consent { display: flex; align-items: center; font-size: 13px; color: #64748b; margin-top: 10px; }
.llpp-consent input { width: auto; margin-right: 10px; }

.llpp-native-select-hidden {
    display: none !important;
}

.llpp-custom-select {
    position: relative;
    width: 100%;
    z-index: 3;
}

.llpp-custom-select-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    justify-content: space-between;
    min-height: 46px;
    padding: 12px 42px 12px 15px;
    position: relative;
    text-align: left;
    width: 100%;
}

.llpp-custom-select-trigger:after {
    border-bottom: 2px solid #64748b;
    border-right: 2px solid #64748b;
    content: "";
    height: 8px;
    position: absolute;
    right: 16px;
    top: 17px;
    transform: rotate(45deg);
    width: 8px;
}

.llpp-custom-select-list {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.2);
    display: none;
    left: 0;
    max-height: min(260px, 42vh);
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10005;
    -webkit-overflow-scrolling: touch;
}

.llpp-custom-select.open .llpp-custom-select-list {
    display: block;
}

.llpp-custom-select.open-above .llpp-custom-select-list {
    bottom: calc(100% + 6px);
    top: auto;
}

.llpp-custom-select-option {
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: #1e293b;
    cursor: pointer;
    display: block;
    font-size: 14px;
    line-height: 1.35;
    padding: 10px 11px;
    text-align: left;
    width: 100%;
}

.llpp-custom-select-option:hover,
.llpp-custom-select-option:focus,
.llpp-custom-select-option.active {
    background: #eff6ff;
    color: var(--llpp-primary);
    outline: none;
}

#llpp-submit-btn {
    width: 100%;
    background: var(--llpp-primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

/* Notifications */
#llpp-notifications-container {
    position: fixed;
    z-index: 9998;
    max-width: 350px;
    width: 100%;
    perspective: 1100px;
}

.llpp-pos-bottom-left { bottom: 90px; left: 30px; }
.llpp-pos-bottom-right { bottom: 90px; right: 30px; }
.llpp-pos-top-right { top: 30px; right: 30px; }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .llpp-overlay {
        align-items: flex-start;
        justify-content: center;
        padding: 12px;
    }

    .llpp-overlay.llpp-select-active {
        overflow-y: auto;
    }

    .llpp-modal {
        border-radius: 14px;
        max-height: calc(100dvh - 24px);
        max-width: none;
        padding: 22px 18px;
        width: 100%;
    }

    .llpp-overlay.llpp-select-active .llpp-modal {
        max-height: none;
        overflow: visible;
    }

    .llpp-close {
        right: 14px;
        top: 14px;
    }

    .llpp-modal-content h3 {
        font-size: 21px;
        line-height: 1.25;
        padding-right: 34px;
    }

    .llpp-modal-content p {
        margin-bottom: 18px;
    }

    .llpp-form-row {
        grid-template-columns: 1fr;
    }

    .llpp-form-group {
        margin-bottom: 12px;
    }

    .llpp-form-group input,
    .llpp-form-group select,
    .llpp-form-group textarea {
        font-size: 16px;
        min-height: 46px;
    }

    .llpp-form-group textarea {
        min-height: 92px;
    }

    #llpp-submit-btn {
        margin-top: 10px;
        min-height: 48px;
    }

    #llpp-notifications-container {
        max-width: calc(100vw - 24px);
        width: auto;
    }

    #llpp-notifications-container.llpp-pos-bottom-left {
        bottom: 80px;
        left: 12px;
        right: auto;
    }

    #llpp-notifications-container.llpp-pos-bottom-right {
        bottom: 80px;
        left: auto;
        right: 12px;
    }

    #llpp-notifications-container.llpp-pos-top-right {
        left: auto;
        right: 12px;
        top: 12px;
    }
    .llpp-notification-item {
        padding: 10px;
        font-size: 13px;
    }
    .llpp-notif-icon {
        width: 32px;
        height: 32px;
    }
}

.llpp-notification-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
    margin-bottom: 15px;
    border-left: 4px solid var(--llpp-primary);
    position: relative;
    overflow: hidden;
    transform-origin: center;
    will-change: opacity, transform, filter;
}

.llpp-notification-item:before {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(34, 197, 94, 0.08));
    content: "";
    height: 80px;
    position: absolute;
    right: -34px;
    top: -44px;
    transform: rotate(24deg);
    width: 120px;
}

@keyframes llpp-slide-up-notif {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.llpp-anim-slide-lift {
    animation: llpp-slide-up-notif 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.llpp-anim-slide-right {
    animation: llpp-slide-right-notif 0.56s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.llpp-anim-fade-scale {
    animation: llpp-fade-scale-notif 0.5s ease-out both;
}

.llpp-anim-pop-bounce {
    animation: llpp-pop-bounce-notif 0.68s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.llpp-anim-flip-3d {
    backface-visibility: hidden;
    animation: llpp-flip-3d-notif 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-style: preserve-3d;
}

.llpp-anim-rotate-card {
    backface-visibility: hidden;
    animation: llpp-rotate-card-notif 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-style: preserve-3d;
}

.llpp-anim-swing-drop {
    animation: llpp-swing-drop-notif 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-origin: top center;
}

.llpp-anim-zoom-tilt {
    animation: llpp-zoom-tilt-notif 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.llpp-anim-soft-blur {
    animation: llpp-soft-blur-notif 0.6s ease-out both;
}

.llpp-anim-elastic-rise {
    animation: llpp-elastic-rise-notif 0.76s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

.llpp-anim-orb-rise-3d {
    animation: llpp-orb-rise-3d-notif 0.82s cubic-bezier(0.18, 1.25, 0.32, 1) both;
    transform-style: preserve-3d;
}

.llpp-anim-cube-turn-3d {
    animation: llpp-cube-turn-3d-notif 0.74s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-style: preserve-3d;
}

.llpp-anim-fold-open-3d {
    animation: llpp-fold-open-3d-notif 0.76s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-origin: bottom center;
    transform-style: preserve-3d;
}

.llpp-anim-glass-float-3d {
    animation: llpp-glass-float-3d-notif 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-style: preserve-3d;
}

.llpp-anim-button-fold-3d,
.llpp-anim-button-launch-3d,
.llpp-anim-button-unfold-3d,
.llpp-anim-button-snap-3d {
    transform-origin: bottom left;
    transform-style: preserve-3d;
}

.llpp-pos-bottom-right .llpp-anim-button-fold-3d,
.llpp-pos-bottom-right .llpp-anim-button-launch-3d,
.llpp-pos-bottom-right .llpp-anim-button-unfold-3d,
.llpp-pos-bottom-right .llpp-anim-button-snap-3d,
.llpp-pos-top-right .llpp-anim-button-fold-3d,
.llpp-pos-top-right .llpp-anim-button-launch-3d,
.llpp-pos-top-right .llpp-anim-button-unfold-3d,
.llpp-pos-top-right .llpp-anim-button-snap-3d {
    transform-origin: bottom right;
}

.llpp-anim-button-fold-3d {
    animation: llpp-button-fold-3d-notif 0.78s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.llpp-anim-button-launch-3d {
    animation: llpp-button-launch-3d-notif 0.78s cubic-bezier(0.18, 1.2, 0.32, 1) both;
}

.llpp-anim-button-unfold-3d {
    animation: llpp-button-unfold-3d-notif 0.82s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.llpp-anim-button-snap-3d {
    animation: llpp-button-snap-3d-notif 0.68s cubic-bezier(0.2, 1.35, 0.3, 1) both;
}

.llpp-notification-exit {
    animation: llpp-notif-exit 0.32s ease-in both !important;
    pointer-events: none;
}

.llpp-exit-orb-rise-3d {
    animation: llpp-orb-rise-3d-exit 0.44s ease-in both !important;
}

.llpp-exit-cube-turn-3d {
    animation: llpp-cube-turn-3d-exit 0.42s ease-in both !important;
}

.llpp-exit-fold-open-3d {
    animation: llpp-fold-open-3d-exit 0.42s ease-in both !important;
}

.llpp-exit-glass-float-3d {
    animation: llpp-glass-float-3d-exit 0.42s ease-in both !important;
}

.llpp-exit-button-fold-3d {
    animation: llpp-button-fold-3d-exit 0.42s ease-in both !important;
}

.llpp-exit-button-launch-3d {
    animation: llpp-button-launch-3d-exit 0.42s ease-in both !important;
}

.llpp-exit-button-unfold-3d {
    animation: llpp-button-unfold-3d-exit 0.42s ease-in both !important;
}

.llpp-exit-button-snap-3d {
    animation: llpp-button-snap-3d-exit 0.38s ease-in both !important;
}

@keyframes llpp-slide-right-notif {
    from { opacity: 0; transform: translateX(-34px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes llpp-fade-scale-notif {
    from { opacity: 0; transform: scale(0.88); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes llpp-pop-bounce-notif {
    0% { opacity: 0; transform: scale(0.72) translateY(18px); }
    64% { opacity: 1; transform: scale(1.04) translateY(-3px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes llpp-flip-3d-notif {
    from { opacity: 0; transform: rotateX(72deg) translateY(18px) scale(0.94); }
    to { opacity: 1; transform: rotateX(0deg) translateY(0) scale(1); }
}

@keyframes llpp-rotate-card-notif {
    from { opacity: 0; transform: rotateY(-56deg) translateX(-22px) scale(0.94); }
    to { opacity: 1; transform: rotateY(0deg) translateX(0) scale(1); }
}

@keyframes llpp-swing-drop-notif {
    0% { opacity: 0; transform: translateY(-28px) rotate(-5deg); }
    58% { opacity: 1; transform: translateY(4px) rotate(2deg); }
    100% { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes llpp-zoom-tilt-notif {
    from { opacity: 0; transform: scale(0.84) rotate(-2deg) translateY(12px); }
    to { opacity: 1; transform: scale(1) rotate(0) translateY(0); }
}

@keyframes llpp-soft-blur-notif {
    from { opacity: 0; filter: blur(10px); transform: translateY(16px) scale(0.98); }
    to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

@keyframes llpp-elastic-rise-notif {
    0% { opacity: 0; transform: translateY(34px) scale(0.94); }
    55% { opacity: 1; transform: translateY(-7px) scale(1.02); }
    78% { transform: translateY(3px) scale(0.995); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes llpp-orb-rise-3d-notif {
    0% {
        border-radius: 999px;
        opacity: 0;
        transform: translateY(64px) rotateX(64deg) scale(0.28);
    }
    58% {
        border-radius: 28px;
        opacity: 1;
        transform: translateY(-8px) rotateX(-8deg) scale(1.03);
    }
    100% {
        border-radius: 12px;
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

@keyframes llpp-cube-turn-3d-notif {
    from { opacity: 0; transform: rotateY(76deg) rotateX(8deg) translateX(34px) scale(0.9); }
    to { opacity: 1; transform: rotateY(0) rotateX(0) translateX(0) scale(1); }
}

@keyframes llpp-fold-open-3d-notif {
    from { opacity: 0; transform: rotateX(-82deg) translateY(26px) scale(0.96); }
    to { opacity: 1; transform: rotateX(0) translateY(0) scale(1); }
}

@keyframes llpp-glass-float-3d-notif {
    0% { opacity: 0; filter: blur(8px); transform: translate3d(0, 38px, -80px) rotateX(24deg) scale(0.9); }
    64% { opacity: 1; filter: blur(0); transform: translate3d(0, -5px, 14px) rotateX(-4deg) scale(1.015); }
    100% { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0) rotateX(0) scale(1); }
}

@keyframes llpp-button-fold-3d-notif {
    0% { opacity: 0; transform: translate3d(0, 58px, -90px) rotateX(-78deg) scale(0.72); }
    62% { opacity: 1; transform: translate3d(0, -5px, 10px) rotateX(8deg) scale(1.015); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0) scale(1); }
}

@keyframes llpp-button-launch-3d-notif {
    0% { opacity: 0; transform: translate3d(0, 74px, -120px) rotateX(54deg) rotateZ(-3deg) scale(0.46); }
    58% { opacity: 1; transform: translate3d(0, -8px, 18px) rotateX(-7deg) rotateZ(1deg) scale(1.03); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0) rotateZ(0) scale(1); }
}

@keyframes llpp-button-unfold-3d-notif {
    0% { opacity: 0; clip-path: inset(92% 8% 0 8% round 999px); transform: translateY(50px) rotateX(-64deg) scale(0.82); }
    56% { opacity: 1; clip-path: inset(0 0 0 0 round 18px); transform: translateY(-6px) rotateX(6deg) scale(1.015); }
    100% { opacity: 1; clip-path: inset(0 0 0 0 round 12px); transform: translateY(0) rotateX(0) scale(1); }
}

@keyframes llpp-button-snap-3d-notif {
    0% { opacity: 0; transform: translateY(62px) rotateX(42deg) scale(0.52); }
    48% { opacity: 1; transform: translateY(-4px) rotateX(-8deg) scale(1.04); }
    72% { transform: translateY(2px) rotateX(3deg) scale(0.99); }
    100% { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

@keyframes llpp-notif-exit {
    to { opacity: 0; filter: blur(2px); transform: translateY(-16px) scale(0.96); }
}

@keyframes llpp-orb-rise-3d-exit {
    to {
        border-radius: 999px;
        opacity: 0;
        transform: translateY(42px) rotateX(42deg) scale(0.36);
    }
}

@keyframes llpp-cube-turn-3d-exit {
    to { opacity: 0; transform: rotateY(-62deg) translateX(-26px) scale(0.9); }
}

@keyframes llpp-fold-open-3d-exit {
    to { opacity: 0; transform: rotateX(74deg) translateY(26px) scale(0.94); }
}

@keyframes llpp-glass-float-3d-exit {
    to { opacity: 0; filter: blur(8px); transform: translate3d(0, -20px, -70px) rotateX(-18deg) scale(0.92); }
}

@keyframes llpp-button-fold-3d-exit {
    to { opacity: 0; transform: translate3d(0, 42px, -70px) rotateX(-58deg) scale(0.72); }
}

@keyframes llpp-button-launch-3d-exit {
    to { opacity: 0; transform: translate3d(0, 62px, -100px) rotateX(42deg) scale(0.48); }
}

@keyframes llpp-button-unfold-3d-exit {
    to { opacity: 0; clip-path: inset(88% 10% 0 10% round 999px); transform: translateY(46px) rotateX(-54deg) scale(0.78); }
}

@keyframes llpp-button-snap-3d-exit {
    to { opacity: 0; transform: translateY(48px) rotateX(32deg) scale(0.56); }
}

.llpp-notif-icon {
    width: 40px;
    height: 40px;
    background: #eff6ff;
    color: var(--llpp-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    position: relative;
    z-index: 1;
}

.llpp-notif-content {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.llpp-notif-text { margin: 0; font-size: 14px; color: #1e293b; font-weight: 500; line-height: 1.4; }
.llpp-notif-time { font-size: 11px; color: #94a3b8; }

.llpp-notif-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: #fee2e2;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #dc2626;
    font-size: 18px;
    font-weight: 700;
    line-height: 22px;
    padding: 0;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.llpp-notif-close:hover,
.llpp-notif-close:focus {
    background: #dc2626;
    color: #fff;
    outline: none;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .llpp-notification-item {
        gap: 10px;
        padding: 11px 38px 11px 11px;
        font-size: 13px;
    }

    .llpp-notif-icon {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
    }

    .llpp-notif-text {
        font-size: 13px;
        line-height: 1.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .llpp-notification-item,
    .llpp-notification-exit {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
