/**
 * AI Share Frontend Styles
 *
 * @package AI_Share
 * @since 1.0.0
 */

/* AI Share Button Container */
.ai-share-button {
    margin: 20px 0;
    text-align: center;
    clear: both;
}

/* AI Share Link */
.ai-share-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    border: none;
    cursor: pointer;
}

.ai-share-link:hover,
.ai-share-link:focus {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-share-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* AI Share Icon */
.ai-share-icon {
    font-size: 16px;
    line-height: 1;
}

/* AI Share Text */
.ai-share-text {
    font-weight: 500;
}

/* Button Style Variations */
.ai-share-style-minimal .ai-share-link {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
    padding: 10px 18px;
}

.ai-share-style-minimal .ai-share-link:hover,
.ai-share-style-minimal .ai-share-link:focus {
    background: #667eea;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.ai-share-style-rounded .ai-share-link {
    border-radius: 25px;
    padding: 12px 24px;
}

/* Sticky Share Button */
.ai-share-sticky-button {
    position: fixed;
    z-index: 9999;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

/* Sticky button positioning */
.ai-share-sticky-left {
    left: 20px;
}

.ai-share-sticky-right {
    right: 20px;
}

.ai-share-sticky-top {
    top: 20px;
}

.ai-share-sticky-middle {
    top: 50%;
    transform: translateY(-50%);
}

.ai-share-sticky-bottom {
    bottom: 20px;
}

/* Sticky button styling - icon only by default */
.ai-share-sticky-button .ai-share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ai-share-sticky-button .ai-share-link:hover,
.ai-share-sticky-button .ai-share-link:focus {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

/* Hide text by default, show on hover */
.ai-share-sticky-button .ai-share-text {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-left: 10px;
    z-index: 10000;
}

.ai-share-sticky-button .ai-share-text::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 4px solid rgba(0, 0, 0, 0.8);
}

.ai-share-sticky-button .ai-share-link:hover .ai-share-text,
.ai-share-sticky-button .ai-share-link:focus .ai-share-text {
    opacity: 1;
    visibility: visible;
}

/* Sticky button icon */
.ai-share-sticky-button .ai-share-icon {
    font-size: 20px;
    line-height: 1;
}

/* Sticky button style variations */
.ai-share-sticky-button.ai-share-style-minimal .ai-share-link {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.ai-share-sticky-button.ai-share-style-minimal .ai-share-link:hover,
.ai-share-sticky-button.ai-share-style-minimal .ai-share-link:focus {
    background: #667eea;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-share-sticky-button.ai-share-style-rounded .ai-share-link {
    border-radius: 25px;
    width: auto;
    height: auto;
    padding: 12px 16px;
}

.ai-share-sticky-button.ai-share-style-rounded .ai-share-text {
    position: static;
    opacity: 1;
    visibility: visible;
    background: none;
    color: inherit;
    padding: 0;
    margin-left: 8px;
    transform: none;
}

.ai-share-sticky-button.ai-share-style-rounded .ai-share-text::before {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-share-button {
        margin: 15px 0;
    }
    
    .ai-share-link {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .ai-share-icon {
        font-size: 14px;
    }
    
    .ai-share-style-rounded .ai-share-link {
        padding: 10px 20px;
    }
    
    /* Mobile sticky button adjustments */
    .ai-share-sticky-button {
        transform: scale(0.9);
    }
    
    .ai-share-sticky-left {
        left: 10px;
    }
    
    .ai-share-sticky-right {
        right: 10px;
    }
    
    .ai-share-sticky-top {
        top: 10px;
    }
    
    .ai-share-sticky-bottom {
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .ai-share-link {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .ai-share-text {
        font-size: 14px;
    }
}

/* Accessibility */
.ai-share-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ai-share-link {
        border: 2px solid currentColor;
    }
    
    .ai-share-style-minimal .ai-share-link {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ai-share-link {
        transition: none;
    }
    
    .ai-share-link:hover,
    .ai-share-link:focus {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ai-share-link {
        background: linear-gradient(135deg, #4c63d2 0%, #5d3a7a 100%);
        box-shadow: 0 2px 8px rgba(76, 99, 210, 0.4);
    }
    
    .ai-share-link:hover,
    .ai-share-link:focus {
        background: linear-gradient(135deg, #3d52c3 0%, #4e2b6b 100%);
        box-shadow: 0 4px 12px rgba(76, 99, 210, 0.5);
    }
    
    .ai-share-style-minimal .ai-share-link {
        color: #4c63d2;
        border-color: #4c63d2;
    }
    
    .ai-share-style-minimal .ai-share-link:hover,
    .ai-share-style-minimal .ai-share-link:focus {
        background: #4c63d2;
        color: #ffffff;
    }
}

/* Print styles */
@media print {
    .ai-share-button {
        display: none;
    }
}

/* Loading state */
.ai-share-button.loading .ai-share-link {
    opacity: 0.7;
    pointer-events: none;
}

.ai-share-button.loading .ai-share-text::after {
    content: '...';
    animation: ai-share-loading 1.5s infinite;
}

@keyframes ai-share-loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Success state */
.ai-share-button.success .ai-share-link {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.ai-share-button.success .ai-share-link:hover,
.ai-share-button.success .ai-share-link:focus {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

/* Error state */
.ai-share-button.error .ai-share-link {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.3);
}

.ai-share-button.error .ai-share-link:hover,
.ai-share-button.error .ai-share-link:focus {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

/* RTL support */
.rtl .ai-share-link {
    flex-direction: row-reverse;
}

/* Custom theme integration */
.ai-share-button {
    /* Allow theme override */
    --ai-share-primary-color: #667eea;
    --ai-share-secondary-color: #764ba2;
    --ai-share-text-color: #ffffff;
    --ai-share-hover-color: #5a6fd8;
    --ai-share-hover-secondary: #6a4190;
    --ai-share-shadow-color: rgba(102, 126, 234, 0.3);
    --ai-share-border-radius: 8px;
    --ai-share-padding: 12px 20px;
    --ai-share-font-size: 14px;
    --ai-share-font-weight: 500;
}

.ai-share-link {
    background: linear-gradient(135deg, var(--ai-share-primary-color) 0%, var(--ai-share-secondary-color) 100%) !important;
    color: var(--ai-share-text-color) !important;
    border-radius: var(--ai-share-border-radius) !important;
    padding: var(--ai-share-padding) !important;
    font-size: var(--ai-share-font-size) !important;
    font-weight: var(--ai-share-font-weight) !important;
    box-shadow: 0 2px 8px var(--ai-share-shadow-color) !important;
}

.ai-share-link:hover,
.ai-share-link:focus {
    background: linear-gradient(135deg, var(--ai-share-hover-color) 0%, var(--ai-share-hover-secondary) 100%);
}
