/* Brand Color Variables with Glassmorphism Transparency (Alpha 0.75) */
:root {
    --color-call: rgba(40, 167, 69, 0.75);
    --color-email: rgba(234, 67, 53, 0.75);
    --color-whatsapp: rgba(37, 211, 102, 0.75);
    --color-telegram: rgba(0, 136, 204, 0.75);
}

/* Independent Button Base - Desktop & Tablet Layout */
.social-widget-item {
    position: fixed;
    right: 0;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border-radius: 6px 0 0 6px;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.15);
    border: 1px solid rgba(255, 255, 255, 0.15); /* Light edge accent for glass aesthetic */
    border-right: none;
    
    /* Native Glassmorphism Blur Filter */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Webkit support for Safari */
    
    /* Core layout animations */
    transition: width 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.2s ease, 
                padding-right 0.2s ease,
                top 0.2s ease;
}

/* Precise Stacking starting at Top 35% (Base/Desktop Layout) */
.widget-call     { top: calc(35% + 0px);   background-color: var(--color-call); }
.widget-email    { top: calc(35% + 56px);  background-color: var(--color-email); } /* 50px height + 6px gap */
.widget-whatsapp { top: calc(35% + 112px); background-color: var(--color-whatsapp); }
.widget-telegram { top: calc(35% + 168px); background-color: var(--color-telegram); }

/* Link & Icon Interior Layout */
.widget-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px; 
    height: 100%;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 20px;
}

/* Desktop Hover & Focus Interactions (Fills the right side gaps) */
@media (min-width: 768px) {
    .social-widget-item:hover,
    .social-widget-item:focus-within {
        width: 58px; 
        padding-right: 8px; 
        margin-right: -8px; /* Pushes extra background past the display frame */
        box-shadow: -4px 4px 12px rgba(0,0,0,0.25);
        outline: none;
    }
}

/* ==========================================
   MODERN CSS TOOLTIPS (Desktop Only)
   ========================================== */
@media (min-width: 768px) {
    .social-widget-item::before {
        content: attr(data-tooltip);
        position: absolute;
        top: 50%;
        right: 65px;
        transform: translateY(-50%) scale(0.8);
        background-color: rgba(30, 30, 30, 0.9);
        backdrop-filter: blur(5px);
        color: #ffffff;
        padding: 6px 12px;
        font-size: 13px;
        font-family: sans-serif;
        white-space: nowrap;
        border-radius: 4px;
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        opacity: 0;
        pointer-events: none;
        transition: all 0.2s ease;
    }

    /* Small pointer indicator */
    .social-widget-item::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 59px;
        transform: translateY(-50%) scale(0.8);
        border-width: 6px 0 6px 6px;
        border-style: solid;
        border-color: transparent transparent transparent rgba(30, 30, 30, 0.9);
        opacity: 0;
        pointer-events: none;
        transition: all 0.2s ease;
    }

    .social-widget-item:hover::before,
    .social-widget-item:hover::after,
    .social-widget-item:focus-within::before,
    .social-widget-item:focus-within::after {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* ==========================================
   MOBILE VIEWPORT RESPONSIVENESS (Right Side)
   ========================================== */
@media (max-width: 767.98px) {
    /* Scale down dimensions to fit compact phone layouts beautifully */
    .social-widget-item {
        width: 42px;
        height: 42px;
    }

    /* Recalculate balanced stack spaces without the close button */
    .widget-call     { top: calc(35% + 0px); }
    .widget-email    { top: calc(35% + 47px); } /* 42px height + 5px gap */
    .widget-whatsapp { top: calc(35% + 94px); }
    .widget-telegram { top: calc(35% + 141px); }

    .widget-link {
        width: 42px;
        font-size: 18px;
    }

    /* Touch screen micro-interactions mimicking desktop glide */
    .social-widget-item:active {
        width: 48px;
        padding-right: 6px;
        margin-right: -6px;
    }

    /* Native tooltips entirely suppressed to shield content layout spaces */
    .social-widget-item::before,
    .social-widget-item::after {
        display: none !important;
    }
}

/* ==========================================
   MOBILE LANDSCAPE VIEWPORT REPOSITIONING
   ========================================== */
@media (max-width: 991.98px) and (max-height: 480px) and (orientation: landscape) {
    /* Scale down dimensions slightly more to optimize landscape screen real estate */
    .social-widget-item {
        width: 38px;
        height: 38px;
    }

    /* Shift the stack higher up and tighten gaps to 4px to prevent overlapping items below */
    .widget-call     { top: calc(25% + 0px); }
    .widget-email    { top: calc(25% + 42px); } /* 38px height + 4px gap */
    .widget-whatsapp { top: calc(25% + 84px); }
    .widget-telegram { top: calc(25% + 126px); }

    /* Adjust the interior link layout to match the new size */
    .widget-link {
        width: 38px;
        font-size: 16px;
    }

    /* Adjust the active touch micro-interaction scale for landscape */
    .social-widget-item:active {
        width: 44px;
        padding-right: 6px;
        margin-right: -6px;
    }
}

