/**
 * Gradient Buttons Styles
 * Based on the provided React component
 *
 * @package Pharmacy_Pro
 */

/* =========================
   Font Face Definitions
   ========================= */
@font-face {
  font-family: 'YekanBakh-Regular';
  src: url('../fonts/YekanBakh-Regular.eot');
  src: url('../fonts/YekanBakh-Regular.eot?#iefix') format('embedded-opentype'),
       url('../fonts/YekanBakh-Regular.woff2') format('woff2'),
       url('../fonts/YekanBakh-Regular.woff') format('woff'),
       url('../fonts/YekanBakh-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'YekanBakh-Thin';
  src: url('../fonts/YekanBakh-Thin.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Base Gradient Button */
.pharmacy-gradient-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 2;
    background: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565);
    background-size: 200%;
    animation: pharmacy-gradient-animate 2s infinite linear;
    color: white;
    font-family: 'YekanBakh-Regular', Arial, sans-serif;
}

/* Button Sizes */
.pharmacy-gradient-button.pharmacy-btn-sm {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 20px;
}

.pharmacy-gradient-button.pharmacy-btn-md {
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 25px;
}

.pharmacy-gradient-button.pharmacy-btn-lg {
    font-size: 18px;
    padding: 16px 32px;
    border-radius: 30px;
}

.pharmacy-gradient-button.pharmacy-btn-xl {
    font-size: 24px;
    padding: 20px 40px;
    border-radius: 35px;
}

/* Glow Effect */
.pharmacy-gradient-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565);
    background-size: 200%;
    animation: pharmacy-gradient-animate 2s infinite linear;
    z-index: -1;
    opacity: 0.8;
}

.pharmacy-gradient-button::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 30%;
    background: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565);
    background-size: 200%;
    animation: pharmacy-gradient-animate 2s infinite linear;
    filter: blur(0.8rem);
    z-index: -2;
}

/* Hover Effects */
.pharmacy-gradient-button:hover {
    animation: pharmacy-gradient-animate 0.5s infinite linear;
    transform: scale(1.05);
    color: white;
    text-decoration: none;
}

.pharmacy-gradient-button:hover::before {
    animation: pharmacy-gradient-animate 0.5s infinite linear;
}

.pharmacy-gradient-button:hover::after {
    animation: pharmacy-gradient-animate 0.5s infinite linear;
}

/* Animation */
@keyframes pharmacy-gradient-animate {
    0% {
        background-position: 0%;
    }
    100% {
        background-position: 200%;
    }
}

/* Button Variants */
.pharmacy-gradient-button.pharmacy-btn-outline {
    background: transparent;
    border: 2px solid;
    border-image: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565) 1;
    color: #333;
}

.pharmacy-gradient-button.pharmacy-btn-outline:hover {
    background: linear-gradient(90deg, #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565);
    color: white;
}

.pharmacy-gradient-button.pharmacy-btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pharmacy-gradient-button.pharmacy-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Custom Color Schemes */
.pharmacy-gradient-button.pharmacy-btn-primary {
    background: linear-gradient(90deg, #2c5aa0, #1e3a8a, #60a5fa);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-primary::before {
    background: linear-gradient(90deg, #2c5aa0, #1e3a8a, #60a5fa);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-primary::after {
    background: linear-gradient(90deg, #2c5aa0, #1e3a8a, #60a5fa);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-success {
    background: linear-gradient(90deg, #10b981, #059669, #34d399);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-success::before {
    background: linear-gradient(90deg, #10b981, #059669, #34d399);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-success::after {
    background: linear-gradient(90deg, #10b981, #059669, #34d399);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-warning {
    background: linear-gradient(90deg, #f59e0b, #d97706, #fbbf24);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-warning::before {
    background: linear-gradient(90deg, #f59e0b, #d97706, #fbbf24);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-warning::after {
    background: linear-gradient(90deg, #f59e0b, #d97706, #fbbf24);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-danger {
    background: linear-gradient(90deg, #ef4444, #dc2626, #f87171);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-danger::before {
    background: linear-gradient(90deg, #ef4444, #dc2626, #f87171);
    background-size: 200%;
}

.pharmacy-gradient-button.pharmacy-btn-danger::after {
    background: linear-gradient(90deg, #ef4444, #dc2626, #f87171);
    background-size: 200%;
}

/* Icon Styles */
.pharmacy-gradient-button i {
    font-size: 1.1em;
}

.pharmacy-gradient-button .pharmacy-btn-icon-before {
    margin-left: 8px;
}

.pharmacy-gradient-button .pharmacy-btn-icon-after {
    margin-right: 8px;
}

/* Loading State */
.pharmacy-gradient-button.pharmacy-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.pharmacy-gradient-button.pharmacy-btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: pharmacy-spin 1s linear infinite;
}

@keyframes pharmacy-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Disabled State */
.pharmacy-gradient-button:disabled,
.pharmacy-gradient-button.pharmacy-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Focus State */
.pharmacy-gradient-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.3);
}

/* RTL Support */
[dir="rtl"] .pharmacy-gradient-button {
    direction: rtl;
}

[dir="rtl"] .pharmacy-gradient-button .pharmacy-btn-icon-before {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .pharmacy-gradient-button .pharmacy-btn-icon-after {
    margin-right: 0;
    margin-left: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pharmacy-gradient-button.pharmacy-btn-xl {
        font-size: 20px;
        padding: 16px 32px;
    }
    
    .pharmacy-gradient-button.pharmacy-btn-lg {
        font-size: 16px;
        padding: 14px 28px;
    }
    
    .pharmacy-gradient-button.pharmacy-btn-md {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .pharmacy-gradient-button.pharmacy-btn-sm {
        font-size: 12px;
        padding: 8px 14px;
    }
}

@media (max-width: 480px) {
    .pharmacy-gradient-button {
        width: 100%;
        justify-content: center;
    }
    
    .pharmacy-gradient-button.pharmacy-btn-xl,
    .pharmacy-gradient-button.pharmacy-btn-lg {
        font-size: 16px;
        padding: 14px 24px;
    }
}

/* WooCommerce Integration */
.woocommerce .pharmacy-gradient-button {
    font-family: inherit;
}

.woocommerce .single_add_to_cart_button.pharmacy-gradient-button {
    width: 100%;
    margin-top: 15px;
}

.woocommerce .woocommerce-loop-product__link.pharmacy-gradient-button {
    display: block;
    text-align: center;
    margin-top: 15px;
}

/* Elementor Integration */
.elementor-widget-pharmacy-gradient-button .pharmacy-gradient-button {
    display: inline-flex;
}

.elementor-widget-pharmacy-gradient-button .pharmacy-gradient-button-wrapper {
    text-align: center;
}

.elementor-widget-pharmacy-gradient-button .pharmacy-gradient-button-wrapper.text-left {
    text-align: left;
}

.elementor-widget-pharmacy-gradient-button .pharmacy-gradient-button-wrapper.text-right {
    text-align: right;
}

/* Custom Properties for Dynamic Colors */
.pharmacy-gradient-button {
    --gradient-colors: #ff6d1b, #ffee55, #5bff89, #4d8aff, #6b5fff, #ff64f9, #ff6565;
    --animation-speed: 2s;
    --hover-animation-speed: 0.5s;
    --glow-size: 4px;
}

/* Dynamic gradient generation */
.pharmacy-gradient-button[data-gradient-colors] {
    background: linear-gradient(90deg, var(--gradient-colors));
    background-size: 200%;
}

.pharmacy-gradient-button[data-gradient-colors]::before {
    background: linear-gradient(90deg, var(--gradient-colors));
    background-size: 200%;
}

.pharmacy-gradient-button[data-gradient-colors]::after {
    background: linear-gradient(90deg, var(--gradient-colors));
    background-size: 200%;
}

/* Animation speed control */
.pharmacy-gradient-button[data-animation-speed] {
    animation: pharmacy-gradient-animate var(--animation-speed) infinite linear;
}

.pharmacy-gradient-button[data-animation-speed]::before {
    animation: pharmacy-gradient-animate var(--animation-speed) infinite linear;
}

.pharmacy-gradient-button[data-animation-speed]::after {
    animation: pharmacy-gradient-animate var(--animation-speed) infinite linear;
}

.pharmacy-gradient-button[data-animation-speed]:hover {
    animation: pharmacy-gradient-animate var(--hover-animation-speed) infinite linear;
}

.pharmacy-gradient-button[data-animation-speed]:hover::before {
    animation: pharmacy-gradient-animate var(--hover-animation-speed) infinite linear;
}

.pharmacy-gradient-button[data-animation-speed]:hover::after {
    animation: pharmacy-gradient-animate var(--hover-animation-speed) infinite linear;
}

/* Glow size control */
.pharmacy-gradient-button[data-glow-size]::after {
    filter: blur(calc(var(--glow-size) * 0.2rem));
}
