/**
 * AR Social Profiles Pro - Frontend Styles v6.0.0
 * Horizontal layout: Icon + Text in same line with same animation
 * User-customizable labels, colors, and animations
 */

/* ===== Main Widget Container ===== */
.arsp-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ===== Position Variations ===== */
.arsp-position-bottom-right {
    bottom: 30px;
    right: 30px;
}

.arsp-position-bottom-left {
    bottom: 30px;
    left: 30px;
}

.arsp-position-top-right {
    top: 30px;
    right: 30px;
}

.arsp-position-top-left {
    top: 30px;
    left: 30px;
}

.arsp-position-middle-right {
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
}

.arsp-position-middle-left {
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
}

/* ===== Main Floating Button ===== */
.arsp-main-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #ee2e24;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.arsp-main-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.arsp-main-button:active {
    transform: scale(0.95);
}

.arsp-main-button .arsp-icon {
    transition: all 0.3s ease;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.arsp-main-button .arsp-close-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(180deg) scale(0);
    transition: all 0.3s ease;
}

.arsp-widget.arsp-open .arsp-main-button .arsp-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

.arsp-widget.arsp-open .arsp-main-button .arsp-close-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Button Image Support - AUTO FIT */
.arsp-button-image {
    width: 36px !important;
    height: 36px !important;
    object-fit: cover;
    border-radius: 50%;
}

/* ===== Main Button Animation Styles ===== */
/* Pulse Animation */
@keyframes arsp-pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 12px rgba(255, 255, 255, 0.2);
    }
}

.arsp-animation-pulse .arsp-main-button {
    animation: arsp-pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
@keyframes arsp-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.arsp-animation-bounce .arsp-main-button {
    animation: arsp-bounce 2s ease-in-out infinite;
}

/* Shake Animation */
@keyframes arsp-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.arsp-animation-shake .arsp-main-button {
    animation: arsp-shake 3s ease-in-out infinite;
}

/* Rotate Animation */
@keyframes arsp-rotate-main {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.arsp-animation-rotate .arsp-main-button .arsp-icon {
    animation: arsp-rotate-main 3s linear infinite;
}

/* Glow Animation */
@keyframes arsp-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(238, 46, 36, 0.6), 0 0 0 8px rgba(238, 46, 36, 0.1);
    }
}

.arsp-animation-glow .arsp-main-button {
    animation: arsp-glow 2s ease-in-out infinite;
}

/* ===== Individual Icon Animations (Applied to whole row) ===== */

/* Float Animation */
@keyframes arsp-icon-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Swing Animation */
@keyframes arsp-icon-swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

/* Heartbeat Animation */
@keyframes arsp-icon-heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.15);
    }
    20%, 40% {
        transform: scale(1);
    }
}

/* Rotate Continuous Animation */
@keyframes arsp-icon-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Tada Animation */
@keyframes arsp-icon-tada {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    10%, 20% {
        transform: scale(1.1) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.15) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.15) rotate(-3deg);
    }
}

/* Jello Animation */
@keyframes arsp-icon-jello {
    0%, 100% {
        transform: skewX(0deg) skewY(0deg);
    }
    30% {
        transform: skewX(12.5deg) skewY(12.5deg);
    }
    40% {
        transform: skewX(-10.5deg) skewY(-10.5deg);
    }
    50% {
        transform: skewX(6.5deg) skewY(6.5deg);
    }
    65% {
        transform: skewX(-3.5deg) skewY(-3.5deg);
    }
    75% {
        transform: skewX(1.5deg) skewY(1.5deg);
    }
}

/* Wobble Animation */
@keyframes arsp-icon-wobble {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    15% {
        transform: translateX(-5px) rotate(-5deg);
    }
    30% {
        transform: translateX(4px) rotate(3deg);
    }
    45% {
        transform: translateX(-3px) rotate(-3deg);
    }
    60% {
        transform: translateX(2px) rotate(2deg);
    }
    75% {
        transform: translateX(-1px) rotate(-1deg);
    }
}

/* Rubber Band Animation */
@keyframes arsp-icon-rubberBand {
    0%, 100% {
        transform: scale(1);
    }
    30% {
        transform: scaleX(1.25) scaleY(0.75);
    }
    40% {
        transform: scaleX(0.75) scaleY(1.25);
    }
    50% {
        transform: scaleX(1.15) scaleY(0.85);
    }
    65% {
        transform: scaleX(0.95) scaleY(1.05);
    }
    75% {
        transform: scaleX(1.05) scaleY(0.95);
    }
}

/* Flash Animation */
@keyframes arsp-icon-flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.3;
    }
}

/* Flip Animation */
@keyframes arsp-icon-flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* ===== Social Menu ===== */
.arsp-menu {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Menu positioning based on widget position */
.arsp-position-bottom-right .arsp-menu,
.arsp-position-middle-right .arsp-menu {
    right: 0;
    bottom: 75px;
    align-items: flex-end;
}

.arsp-position-bottom-left .arsp-menu,
.arsp-position-middle-left .arsp-menu {
    left: 0;
    bottom: 75px;
    align-items: flex-start;
}

.arsp-position-top-right .arsp-menu {
    right: 0;
    top: 75px;
    align-items: flex-end;
}

.arsp-position-top-left .arsp-menu {
    left: 0;
    top: 75px;
    align-items: flex-start;
}

/* ===== NEW: Menu Item Row (Icon + Text Horizontal) ===== */
.arsp-menu-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

/* Show row when menu opens */
.arsp-widget.arsp-open .arsp-menu-item-row {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    /* Remove transition after opening to allow animations */
    transition: opacity 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Apply animations to entire row (icon + text together) */
.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-float {
    animation: arsp-icon-float 2.5s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-swing {
    animation: arsp-icon-swing 2s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-heartbeat {
    animation: arsp-icon-heartbeat 1.5s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-rotate {
    animation: arsp-icon-rotate 3s linear infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-tada {
    animation: arsp-icon-tada 1.5s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-jello {
    animation: arsp-icon-jello 1.5s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-wobble {
    animation: arsp-icon-wobble 1.5s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-rubberBand {
    animation: arsp-icon-rubberBand 1.5s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-flash {
    animation: arsp-icon-flash 2s ease-in-out infinite 0.3s;
    animation-fill-mode: both;
}

.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-flip {
    animation: arsp-icon-flip 3s linear infinite 0.3s;
    animation-fill-mode: both;
}

/* No animation option */
.arsp-widget.arsp-open .arsp-menu-item-row.arsp-anim-none {
    animation: none;
}

/* ===== Menu Icon (Circular Button) ===== */
.arsp-menu-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.arsp-menu-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.arsp-menu-icon:active {
    transform: scale(1.05);
}

/* Icon hover effect */
.arsp-menu-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.arsp-menu-icon:hover::before {
    width: 100%;
    height: 100%;
}

/* Profile Image Support - AUTO FIT IN CIRCLE */
.arsp-profile-image {
    width: 32px !important;
    height: 32px !important;
    object-fit: cover;
    border-radius: 50%;
    padding: 2px;
    background: white;
}

/* ===== Menu Label (Text beside icon) ===== */
.arsp-menu-label {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    /* User-customizable colors applied via inline styles */
}

.arsp-menu-label:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* ===== Backdrop ===== */
.arsp-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.arsp-widget.arsp-open .arsp-backdrop {
    opacity: 1;
    pointer-events: all;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .arsp-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .arsp-position-bottom-right,
    .arsp-position-bottom-left {
        bottom: 20px;
    }
    
    .arsp-position-bottom-left,
    .arsp-position-top-left,
    .arsp-position-middle-left {
        left: 20px;
    }
    
    .arsp-position-bottom-right,
    .arsp-position-top-right,
    .arsp-position-middle-right {
        right: 20px;
    }
    
    .arsp-position-top-right,
    .arsp-position-top-left {
        top: 20px;
    }
    
    .arsp-main-button {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .arsp-menu-icon {
        width: 45px;
        height: 45px;
        min-width: 45px;
        font-size: 18px;
    }
    
    .arsp-button-image {
        width: 30px !important;
        height: 30px !important;
    }
    
    .arsp-profile-image {
        width: 28px !important;
        height: 28px !important;
    }
    
    .arsp-menu-label {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Hide on mobile if disabled */
@media (max-width: 768px) {
    .arsp-hide-mobile {
        display: none !important;
    }
}

/* ===== Accessibility ===== */
.arsp-main-button:focus,
.arsp-menu-icon:focus,
.arsp-menu-label:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .arsp-widget {
        display: none !important;
    }
}

/* ===== Smooth Transitions ===== */
* {
    -webkit-tap-highlight-color: transparent;
}

.arsp-widget * {
    box-sizing: border-box;
}

/* ===== Loading State ===== */
.arsp-widget.arsp-loading .arsp-main-button {
    pointer-events: none;
    opacity: 0.7;
}

/* ===== Icon Sizing ===== */
.arsp-main-button i {
    font-size: 24px;
}

.arsp-menu-icon i {
    font-size: 20px;
}

/* ===== Animation Performance ===== */
.arsp-widget,
.arsp-main-button,
.arsp-menu-item-row {
    will-change: transform, opacity;
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
    .arsp-main-button,
    .arsp-menu-icon {
        border: 2px solid white;
    }
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
    .arsp-widget * {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
