/*──────────────────────────────────────────────────────────────────────
  AgroMind WhatsApp Share – Front-end Styles v2.0
  ──────────────────────────────────────────────────────────────────────*/

/* ══════════════════════════════════════════════════════════════════════
   Shortcode Wrapper (centered)
   ══════════════════════════════════════════════════════════════════════ */
.agromind-wa-wrap {
    text-align: center;
    margin: 12px 0;
}

/* ══════════════════════════════════════════════════════════════════════
   Base Button
   ══════════════════════════════════════════════════════════════════════ */
.agromind-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #ffffff !important;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow:
        0 4px 14px rgba(37, 211, 102, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.22s ease,
        background 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Shine sweep */
.agromind-wa-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

.agromind-wa-btn:hover::before {
    left: 125%;
}

/* Hover */
.agromind-wa-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 8px 24px rgba(37, 211, 102, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #2be06f 0%, #159c8a 100%);
    color: #ffffff !important;
}

.agromind-wa-btn:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 3px;
}

.agromind-wa-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 2px 8px rgba(37, 211, 102, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Icon */
.agromind-wa-icon {
    flex-shrink: 0;
    display: block;
    transition: transform 0.22s ease;
}

.agromind-wa-btn:hover .agromind-wa-icon {
    transform: rotate(-8deg) scale(1.1);
}

/* Label */
.agromind-wa-label {
    white-space: nowrap;
}

/* Icon-only variant */
.agromind-wa-btn--icon {
    padding: 12px;
    border-radius: 50%;
    justify-content: center;
}

/* Pulse on load */
@keyframes agromind-wa-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70%  { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.agromind-wa-btn {
    animation: agromind-wa-pulse 2s ease-out 1s 2;
}

/* ══════════════════════════════════════════════════════════════════════
   Size Variants
   ══════════════════════════════════════════════════════════════════════ */

/* ── Small ──────────────────────────────────────────────────────────── */
.agromind-wa-btn--small {
    padding: 8px 18px;
    font-size: 13px;
    gap: 7px;
    border-radius: 40px;
}

.agromind-wa-btn--small .agromind-wa-icon {
    width: 18px;
    height: 18px;
}

.agromind-wa-btn--small.agromind-wa-btn--icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* ── Medium (default) ───────────────────────────────────────────────── */
.agromind-wa-btn--medium {
    padding: 12px 26px;
    font-size: 15px;
    gap: 10px;
}

.agromind-wa-btn--medium .agromind-wa-icon {
    width: 22px;
    height: 22px;
}

.agromind-wa-btn--medium.agromind-wa-btn--icon {
    padding: 12px;
    width: 48px;
    height: 48px;
}

/* ── Large ──────────────────────────────────────────────────────────── */
.agromind-wa-btn--large {
    padding: 16px 34px;
    font-size: 17px;
    gap: 12px;
    border-radius: 56px;
}

.agromind-wa-btn--large .agromind-wa-icon {
    width: 26px;
    height: 26px;
}

.agromind-wa-btn--large.agromind-wa-btn--icon {
    padding: 16px;
    width: 60px;
    height: 60px;
}

/* ══════════════════════════════════════════════════════════════════════
   Device Visibility
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .agromind-wa-desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .agromind-wa-mobile-only {
        display: none !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   Floating Button
   ══════════════════════════════════════════════════════════════════════
   Uses !important on critical properties to prevent theme overrides
   from breaking the circular shape and icon sizing.
   ══════════════════════════════════════════════════════════════════════ */
.agromind-wa-floating {
    /* Reset common theme interference */
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-indent: 0 !important;
    text-align: center !important;
    float: none !important;
    clear: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 1 / 1 !important;

    /* Positioning & layout */
    position: fixed !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Shape */
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;

    /* Appearance */
    text-decoration: none !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%) !important;
    box-shadow:
        0 6px 20px rgba(37, 211, 102, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer !important;
    overflow: visible !important;

    transition:
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;
    animation: agromind-wa-float-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both,
               agromind-wa-pulse 2s ease-out 1.5s 2;
}

/* ── Size adjustments for floating ───────────────────────────────── */
.agromind-wa-floating.agromind-wa-btn--small {
    width: 48px !important;
    height: 48px !important;
}

.agromind-wa-floating.agromind-wa-btn--small .agromind-wa-icon {
    width: 26px !important;
    height: 26px !important;
}

.agromind-wa-floating.agromind-wa-btn--medium {
    width: 60px !important;
    height: 60px !important;
}

.agromind-wa-floating.agromind-wa-btn--medium .agromind-wa-icon {
    width: 32px !important;
    height: 32px !important;
}

.agromind-wa-floating.agromind-wa-btn--large {
    width: 72px !important;
    height: 72px !important;
}

.agromind-wa-floating.agromind-wa-btn--large .agromind-wa-icon {
    width: 40px !important;
    height: 40px !important;
}

/* Positions */
.agromind-wa-floating--bottom-right {
    right: 24px !important;
}

.agromind-wa-floating--bottom-left {
    left: 24px !important;
}

/* Hover */
.agromind-wa-floating:hover {
    transform: scale(1.12);
    box-shadow:
        0 10px 32px rgba(37, 211, 102, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.15);
    color: #ffffff !important;
}

.agromind-wa-floating:active {
    transform: scale(0.95);
}

/* Icon inside floating */
.agromind-wa-floating .agromind-wa-icon {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
    display: block !important;
    transition: transform 0.25s ease;
}

.agromind-wa-floating:hover .agromind-wa-icon {
    transform: rotate(-10deg) scale(1.1);
}

/* Tooltip */
.agromind-wa-floating__tooltip {
    position: absolute;
    white-space: nowrap;
    background: #1a1a2e;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.agromind-wa-floating--bottom-right .agromind-wa-floating__tooltip {
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
}

.agromind-wa-floating--bottom-left .agromind-wa-floating__tooltip {
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
}

.agromind-wa-floating:hover .agromind-wa-floating__tooltip {
    opacity: 1;
}

.agromind-wa-floating--bottom-right:hover .agromind-wa-floating__tooltip {
    transform: translateY(-50%) translateX(0);
}

.agromind-wa-floating--bottom-left:hover .agromind-wa-floating__tooltip {
    transform: translateY(-50%) translateX(0);
}

/* Tooltip arrow */
.agromind-wa-floating__tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
}

.agromind-wa-floating--bottom-right .agromind-wa-floating__tooltip::after {
    right: -12px;
    border-left-color: #1a1a2e;
}

.agromind-wa-floating--bottom-left .agromind-wa-floating__tooltip::after {
    left: -12px;
    border-right-color: #1a1a2e;
}

/* Float-in entrance animation */
@keyframes agromind-wa-float-in {
    from {
        opacity: 0;
        transform: scale(0.3) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ══════════════════════════════════════════════════════════════════════
   Responsive tweaks
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .agromind-wa-btn--large {
        padding: 12px 26px;
        font-size: 15px;
    }

    .agromind-wa-floating--bottom-right {
        bottom: 16px;
        right: 16px;
    }

    .agromind-wa-floating--bottom-left {
        bottom: 16px;
        left: 16px;
    }
}
