/* Base Wrapper */
.ab-wrapper {
    position: relative;
    z-index: 99;
    transition: all 0.3s ease;
}

/* Visibility States */
.ab-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.ab-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Mode: Normal */
.ab-mode-normal {
    display: inline-block;
}

/* Mode: Floating */
.ab-mode-floating {
    /* Position set by inline style or generic class, but usually fixed/absolute */
}

.ab-pos-fixed {
    position: fixed;
}

.ab-pos-absolute {
    position: absolute;
}

/* Corner Presets */
.ab-corner-bottom_right {
    bottom: 20px;
    right: 20px;
}

.ab-corner-bottom_left {
    bottom: 20px;
    left: 20px;
}

.ab-corner-top_right {
    top: 20px;
    right: 20px;
}

.ab-corner-top_left {
    top: 20px;
    left: 20px;
}

/* Button Base */
.ab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    /* Default resets */
    background: #0073e6;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    line-height: 1.2;
}

.ab-btn:focus {
    outline: none;
}

.ab-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

/* Icon */
.ab-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Text */
.ab-text-wrap {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.ab-align-center .ab-text-wrap {
    text-align: center;
}

.ab-align-right .ab-text-wrap {
    text-align: right;
}

.ab-main-text {
    font-weight: 600;
}

.ab-sub-text {
    font-size: 0.85em;
    opacity: 0.9;
}

/* Badge */
.ab-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    /* Default size buffer */
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    z-index: 2;
}

.ab-badge-top_right {
    top: -5px;
    right: -5px;
}

.ab-badge-top_left {
    top: -5px;
    left: -5px;
}

/* Close Button */
.ab-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.ab-wrapper:hover .ab-close {
    opacity: 1;
}

/* Device Visibility */
@media (min-width: 1025px) {
    .ab-hide-desktop {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .ab-hide-tablet {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .ab-hide-mobile {
        display: none !important;
    }
}

/* Animations Keyframes */
@keyframes abFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes abPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes abGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
}

/* Applied Animations */
/* Only animate when revealed if configured */
.ab-anim-fade-in.ab-reveal-animated .ab-btn,
.ab-anim-fade-in:not(.ab-reveal-waiting) .ab-btn {
    animation: abFadeIn 0.8s ease forwards;
}

.ab-anim-pulse .ab-btn {
    animation: abPulse 2s infinite;
}

.ab-anim-glow .ab-btn {
    animation: abGlow 2s infinite;
}

/* Additional placeholder animations as per requirements */
.ab-anim-outline-sweep .ab-btn {
    /* Implementation depends on complex css, simplified here */
    transition: all 0.3s;
}

.ab-anim-outline-sweep .ab-btn:hover {
    box-shadow: inset 0 0 0 2px currentColor;
}

/* Alignment */
.ab-align-left {
    justify-content: flex-start;
}

.ab-align-center {
    justify-content: center;
}

.ab-align-right {
    justify-content: flex-end;
}

/* Icon Order */
.ab-icon-before .ab-inner {
    flex-direction: row;
}

.ab-icon-after .ab-inner {
    flex-direction: row-reverse;
}

.ab-icon-top .ab-inner {
    flex-direction: column;
    text-align: center;
}

/* Full Width */
.ab-full-width .ab-btn {
    width: 100%;
}

/* RTL Support */
body.rtl .ab-icon-before .ab-inner {
    flex-direction: row;
}

body.rtl .ab-corner-bottom_right {
    left: 20px;
    right: auto;
}

body.rtl .ab-corner-bottom_left {
    right: 20px;
    left: auto;
}