/**
 * HAG Social Share Widget Styles
 * Version: 2.0.0
 */

/* =====================================
   CSS Variables
   ===================================== */
   :root {
    --hag-primary-color: #4a90e2;
    --hag-secondary-color: #f39c12;
    --hag-text-color: #333333;
    --hag-light-text: #666666;
    --hag-border-color: #e0e0e0;
    --hag-bg-light: #f5f5f5;
    --hag-bg-white: #ffffff;
    --hag-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --hag-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --hag-transition: all 0.3s ease;
    --hag-spacing: 20px;
    --hag-border-radius: 8px;
}

/* Dark Mode Variables 
@media (prefers-color-scheme: dark) {
    :root {
        --hag-text-color: #e0e0e0;
        --hag-light-text: #b0b0b0;
        --hag-border-color: #404040;
        --hag-bg-light: #2a2a2a;
        --hag-bg-white: #ffffff;
        --hag-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        --hag-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}*/

/* =====================================
   Base Container Styles
   ===================================== */
.hag-social-share {
    background: var(--hag-bg-white);
    border-radius: var(--hag-border-radius);
    box-shadow: var(--hag-shadow);
    padding: 30px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    transition: var(--hag-transition);
}

.hag-social-share * {
    box-sizing: border-box;
}

/* =====================================
   Title & Description
   ===================================== */
.hag-social__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--hag-text-color);
    margin: 0 0 15px;
    text-align: center;
    line-height: 1.4;
}

.hag-social__description {
    font-size: 14px;
    color: var(--hag-light-text);
    margin: 0 0 20px;
    text-align: center;
    line-height: 1.6;
}

/* =====================================
   Social Links Container
   ===================================== */
.hag-social__links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 0 0 var(--hag-spacing);
}

/* Layout Variations */
.hag-layout-grid .hag-social__links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 15px;
}

.hag-layout-inline .hag-social__links {
    display: inline-flex;
    flex-wrap: wrap;
}

.hag-layout-vertical .hag-social__links {
    flex-direction: column;
    align-items: stretch;
}

.hag-layout-vertical .hag-social__link {
    width: 100% !important;
    justify-content: flex-start;
    padding: 12px 20px;
}

/* =====================================
   Social Link Buttons
   ===================================== */
.hag-social__link {
    position: relative;
    display: inline-flex;
    align-items: normal;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--hag-bg-light);
    color: var(--hag-text-color);
    font-size: 20px;
    text-decoration: none;
    transition: var(--hag-transition);
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
    border: 2px solid transparent;
}

.hag-social__link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.15;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: -1;
}

.hag-social__link:hover::before {
    width: 200%;
    height: 200%;
}

.hag-social__link i,
.hag-social__link svg {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.hag-social__link:focus {
    outline: 2px solid var(--hag-primary-color);
    outline-offset: 2px;
}

/* Default Network Colors */
.hag-social__link[data-network="Facebook"] {
    background: #3b5998;
    color: #ffffff;
}

.hag-social__link[data-network="Twitter"] {
    background: #000;
    color: #ffffff;
}

.hag-social__link[data-network="LinkedIn"] {
    background: #0077b5;
    color: #ffffff;
}

.hag-social__link[data-network="Telegram"] {
    background: #0088cc;
    color: #ffffff;
}

.hag-social__link[data-network="WhatsApp"] {
    background: #25d366;
    color: #ffffff;
}

.hag-social__link[data-network="Pinterest"] {
    background: #bd081c;
    color: #ffffff;
}

.hag-social__link[data-network="Email"] {
    background: #ea4335;
    color: #ffffff;
}

.hag-social__link[data-network="Print"] {
    background: #607d8b;
    color: #ffffff;
}

/* =====================================
   Hover Animations
   ===================================== */
.hag-hover-grow:hover {
    transform: scale(1.15);
}

.hag-hover-shrink:hover {
    transform: scale(0.9);
}

.hag-hover-pulse:hover {
    animation: hag-pulse 0.6s ease-in-out;
}

.hag-hover-rotate:hover {
    transform: rotate(360deg);
}

.hag-hover-bounce:hover {
    animation: hag-bounce 0.6s ease-in-out;
}

@keyframes hag-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes hag-bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-5px); }
}

/* =====================================
   Copy URL Section
   ===================================== */


   
.hag-copy-url {
    display: flex;
    gap: 10px;
    margin-top: var(--hag-spacing);
    align-items: stretch;
}

.hag-copy-url__input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--hag-border-color);
    border-radius: var(--hag-border-radius);
    background: var(--hag-bg-light);
    color: var(--hag-text-color);
    font-size: 14px;
    font-family: "Pelak", Sans-serif;
    transition: var(--hag-transition);
    outline: none;
    direction:ltr !important;
}

.hag-copy-url__input:focus {
    border-color: var(--hag-primary-color);
    background: var(--hag-bg-white);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.hag-copy-url__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: var(--hag-primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--hag-border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hag-transition);
    white-space: nowrap;
    outline: none;
}

.hag-copy-url__button:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: var(--hag-shadow-hover);
}

.hag-copy-url__button:active {
    transform: translateY(0);
}

.hag-copy-url__button:focus {
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
}

.hag-copy-url__button i {
    font-size: 16px;
}

/* Copied State */
.hag-copy-url.hag-copied .hag-copy-url__button {
    background: #27ae60;
    pointer-events: none;
}

.hag-copy-url.hag-copied .hag-copy-url__button i::before {
    content: '\f00c'; /* FontAwesome check icon */
}

/* Copy URL Field - Success State */
.hag-copy-url.copied {
    border-color: #4CAF50 !important;
    background-color: #E8F5E9 !important;
    color: #2E7D32 !important;
}

/* Copy Button - Success State */
.hag-copy-btn.copied {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4) !important;
}

.hag-copy-btn.copied i {
    animation: checkBounce 0.5s ease;
}

@keyframes checkBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Copy Button - Error State */
.hag-copy-btn.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%) !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Copy Button - Normal State */
.hag-copy-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hag-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.hag-copy-btn:active {
    transform: translateY(0);
}

/* Share Count Animation */
.hag-share-count.updated {
    animation: countPulse 0.5s ease;
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); color: #4CAF50; }
}


/* =====================================
   QR Code Section
   ===================================== 
.hag-qr-code {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--hag-spacing);
    padding: 20px;
}

.hag-qr-code__image {
    display: block;
    max-width: 100%;
    height: auto;
    background: var(--hag-bg-white);
    padding: 15px;
    border: 2px solid var(--hag-border-color);
    border-radius: var(--hag-border-radius);
    box-shadow: var(--hag-shadow);
    transition: var(--hag-transition);
    cursor: pointer;
}

.hag-qr-code__image:hover {
    transform: scale(1.05);
    box-shadow: var(--hag-shadow-hover);
    border-color: var(--hag-primary-color);
}*/

/* QR Code Container */
.hag-qr-code {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
	margin: 20px 0 !important;
}

.hag-qr-code:hover {
    transform: scale(1.05);
}

.hag-qr-code img {
    display: block;
    pointer-events: none; /* Prevent image from being dragged/opened */
    user-select: none;
}

/* QR Code - Copied State */
.hag-qr-code.copied {
    animation: qrPulse 0.6s ease;
}

@keyframes qrPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
    }
}

/* QR Code Copy Feedback */
.hag-qr-copy-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    white-space: nowrap;
    z-index: 1000;
}

.hag-qr-copy-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.hag-qr-copy-feedback.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}




/* Prevent text selection on QR Code */
.hag-qr-code,
.hag-qr-code * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* QR Code wrapper in widget */
.hag-qr-wrapper {
    text-align: center;
    margin-top: 15px;
}

.hag-qr-wrapper .hag-qr-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Responsive QR Code */
@media (max-width: 768px) {
    .hag-qr-code::before {
        font-size: 11px;
        padding: 6px 10px;
        bottom: -30px;
    }
    
    .hag-qr-copy-feedback {
        font-size: 12px;
        padding: 10px 16px;
    }
}


/* =====================================
   Sticky Positions
   ===================================== */
   .hag-sticky-left,
   .hag-sticky-right,
   .hag-sticky-bottom {
       position: fixed;
       z-index: 9999;
       box-shadow: var(--hag-shadow-hover);
       margin: 0;
   }
   
   .hag-sticky-left {
       left: 20px;
       top: 50%;
       transform: translateY(-50%);
       max-width: 80px;
       padding: 15px 10px;
   }
   
   .hag-sticky-left .hag-social__links {
       flex-direction: column;
       gap: 10px;
   }
   
   .hag-sticky-left .hag-social__title,
   .hag-sticky-left .hag-social__description,
   .hag-sticky-left .hag-copy-url,
   .hag-sticky-left .hag-qr-code {
       display: none;
   }
   
   .hag-sticky-right {
       right: 20px;
       top: 50%;
       transform: translateY(-50%);
       max-width: 80px;
       padding: 15px 10px;
   }
   
   .hag-sticky-right .hag-social__links {
       flex-direction: column;
       gap: 10px;
   }
   
   .hag-sticky-right .hag-social__title,
   .hag-sticky-right .hag-social__description,
   .hag-sticky-right .hag-copy-url,
   .hag-sticky-right .hag-qr-code {
       display: none;
   }
   
   .hag-sticky-bottom {
       left: 50%;
       bottom: 20px;
       transform: translateX(-50%);
       max-width: 90%;
       width: auto;
       padding: 15px 25px;
   }
   
   .hag-sticky-bottom .hag-social__title,
   .hag-sticky-bottom .hag-social__description {
       display: none;
   }
   
   .hag-sticky-bottom .hag-social__links {
       margin: 0;
   }
   
   /* =====================================
      Responsive Design
      ===================================== */
   @media (max-width: 768px) {
       .hag-social-share {
           padding: 20px;
       }
   
       .hag-social__title {
           font-size: 20px;
       }
   
       .hag-social__links {
           gap: 10px;
       }
   
       .hag-social__link {
           width: 45px;
           height: 45px;
           font-size: 18px;
       }
   
       .hag-layout-grid .hag-social__links {
           grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
       }
   
       .hag-copy-url {
		   flex-direction: column-reverse;
       }
   
       .hag-copy-url__button {
           width: 100%;
           justify-content: center;
       }
   
       .hag-sticky-left,
       .hag-sticky-right {
           left: 10px;
           right: auto;
           max-width: 60px;
           padding: 10px 5px;
       }
   
       .hag-sticky-left .hag-social__link,
       .hag-sticky-right .hag-social__link {
           width: 40px;
           height: 40px;
           font-size: 16px;
       }
   
       .hag-sticky-bottom {
           max-width: 95%;
           padding: 12px 15px;
       }
   }
   
   @media (max-width: 480px) {
       .hag-social__title {
           font-size: 18px;
       }
   
       .hag-social__description {
           font-size: 13px;
       }
   
       .hag-social__link {
           width: 40px;
           height: 40px;
           font-size: 16px;
       }
   
       .hag-qr-code {
           padding: 15px;
       }
   }
   
      @media (max-width: 1300px) {
       .hag-copy-url {
               flex-direction: column-reverse;
    justify-content: center;
}
.hag-copy-url__button {
        display: flex;
    justify-content: center;

}
       }

   
   /* =====================================
      Loading State
      ===================================== */
   .hag-social-share.hag-loading {
       opacity: 0.6;
       pointer-events: none;
   }
   
   .hag-social-share.hag-loading::after {
       content: '';
       position: absolute;
       top: 50%;
       left: 50%;
       width: 40px;
       height: 40px;
       margin: -20px 0 0 -20px;
       border: 3px solid var(--hag-border-color);
       border-top-color: var(--hag-primary-color);
       border-radius: 50%;
       animation: hag-spin 0.8s linear infinite;
   }
   
   @keyframes hag-spin {
       to { transform: rotate(360deg); }
   }
   
   /* =====================================
      Accessibility
      ===================================== */
   .hag-social__link:focus-visible {
       outline: 3px solid var(--hag-primary-color);
       outline-offset: 3px;
   }
   
   .hag-copy-url__button:focus-visible {
       outline: 3px solid var(--hag-primary-color);
       outline-offset: 2px;
   }
   
   /* Screen reader only */
   .hag-sr-only {
       position: absolute;
       width: 1px;
       height: 1px;
       padding: 0;
       margin: -1px;
       overflow: hidden;
       clip: rect(0, 0, 0, 0);
       white-space: nowrap;
       border-width: 0;
   }
   
   /* =====================================
      Print Styles
      ===================================== */
   @media print {
       .hag-social-share {
           box-shadow: none;
           border: 1px solid #ccc;
       }
   
       .hag-social__link {
           color: #000 !important;
           background: #fff !important;
           border: 1px solid #000 !important;
       }
   
       .hag-sticky-left,
       .hag-sticky-right,
       .hag-sticky-bottom {
           position: static;
           transform: none;
       }
   }
   
   /* =====================================
      RTL Support
      ===================================== */
   [dir="rtl"] .hag-social__links {
       direction: rtl;
   }
   
   [dir="rtl"] .hag-copy-url {
       direction: rtl;
   }
   
   [dir="rtl"] .hag-sticky-left {
       left: auto;
       right: 20px;
   }
   
   [dir="rtl"] .hag-sticky-right {
       right: auto;
       left: 20px;
   }
   
   /* =====================================
      Custom Animations
      ===================================== */
   @keyframes hag-fadeIn {
       from {
           opacity: 0;
           transform: translateY(20px);
       }
       to {
           opacity: 1;
           transform: translateY(0);
       }
   }
   
   @keyframes hag-slideUp {
       from {
           opacity: 0;
           transform: translateY(30px);
       }
       to {
           opacity: 1;
           transform: translateY(0);
       }
   }
   
   @keyframes hag-bounce-in {
       0% {
           opacity: 0;
           transform: scale(0.3);
       }
       50% {
           opacity: 1;
           transform: scale(1.05);
       }
       70% {
           transform: scale(0.9);
       }
       100% {
           transform: scale(1);
       }
   }
   
   @keyframes hag-pulse-in {
       0% {
           opacity: 0;
           transform: scale(0.95);
       }
       50% {
           opacity: 1;
           transform: scale(1.02);
       }
       100% {
           transform: scale(1);
       }
   }
   
   /* Apply entrance animations */
   .hag-animation-fadeIn {
       animation: hag-fadeIn 0.6s ease-out;
   }
   
   .hag-animation-slideUp {
       animation: hag-slideUp 0.6s ease-out;
   }
   
   .hag-animation-bounce {
       animation: hag-bounce-in 0.8s ease-out;
   }
   
   .hag-animation-pulse {
       animation: hag-pulse-in 0.6s ease-out;
   }
   

   /* =====================================
   Share Counter Styles
   ===================================== */
.hag-share-count {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    background: var(--hag-secondary-color);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    animation: hag-count-pop 0.3s ease-out;
}

@keyframes hag-count-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.hag-social__link {
    position: relative; /* Required for counter positioning */
}

/* RTL Support for counter */
[dir="rtl"] .hag-share-count {
    right: auto;
    left: -5px;
}
