/**
 * Text Checker Sharing Styles
 * 
 * Styles for the sharing functionality including share button,
 * popup, and version mismatch banner.
 * 
 * @package Kitchor Child
 * @version 2.0.0
 */

/* ============================================================================
   Share Button Container
   ============================================================================ */

.kitchor-text-checker-share {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

/* ============================================================================
   Share Button
   ============================================================================ */

.kitchor-text-checker-share__button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: #374151;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kitchor-text-checker-share__button:hover:not(:disabled) {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.kitchor-text-checker-share__button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.kitchor-text-checker-share__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kitchor-text-checker-share__button.is-loading {
    pointer-events: none;
}

.kitchor-text-checker-share__button.is-loading .kitchor-text-checker-share__icon {
    animation: kitchor-share-spin 1s linear infinite;
}

@keyframes kitchor-share-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.kitchor-text-checker-share__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.kitchor-text-checker-share__text {
    white-space: nowrap;
}

/* ============================================================================
   Share Popup
   ============================================================================ */

.kitchor-text-checker-share__popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: stretch;
    min-width: 320px;
    max-width: 400px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: kitchor-share-popup-in 0.15s ease-out;
}

@keyframes kitchor-share-popup-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kitchor-text-checker-share__popup--error {
    padding: 12px 16px;
    gap: 8px;
    color: #991b1b;
    background-color: #fef2f2;
    border-color: #fecaca;
}

.kitchor-text-checker-share__error-icon {
    flex-shrink: 0;
    font-size: 16px;
}

/* ============================================================================
   Share Input
   ============================================================================ */

.kitchor-text-checker-share__input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    color: #374151;
    background-color: #f9fafb;
    border: none;
    border-radius: 8px 0 0 8px;
    outline: none;
}

.kitchor-text-checker-share__input:focus {
    background-color: #f3f4f6;
}

/* ============================================================================
   Copy Button
   ============================================================================ */

.kitchor-text-checker-share__copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    background-color: #3b82f6;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.kitchor-text-checker-share__copy:hover {
    background-color: #2563eb;
}

.kitchor-text-checker-share__copy:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.kitchor-text-checker-share__copy.is-copied {
    background-color: #10b981;
}

.kitchor-text-checker-share__copy svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================================================
   Version Mismatch Banner
   ============================================================================ */

.kitchor-text-checker-version-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #1e40af;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.kitchor-text-checker-version-banner__icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
}

.kitchor-text-checker-version-banner__text {
    flex: 1;
}

.kitchor-text-checker-version-banner__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    color: #3b82f6;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.kitchor-text-checker-version-banner__close:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.kitchor-text-checker-version-banner__close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.kitchor-text-checker-version-banner__close svg {
    width: 16px;
    height: 16px;
}

/* ============================================================================
   Responsive Adjustments
   ============================================================================ */

@media (max-width: 480px) {
    .kitchor-text-checker-share__popup {
        min-width: 280px;
        right: -8px;
    }
    
    .kitchor-text-checker-share__text {
        display: none;
    }
    
    .kitchor-text-checker-share__button {
        padding: 8px;
    }
}

/* ============================================================================
   Dark Mode Support (if needed)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .kitchor-text-checker-share__button {
        color: #e5e7eb;
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .kitchor-text-checker-share__button:hover:not(:disabled) {
        background-color: #4b5563;
        border-color: #6b7280;
    }
    
    .kitchor-text-checker-share__popup {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .kitchor-text-checker-share__input {
        color: #e5e7eb;
        background-color: #111827;
    }
    
    .kitchor-text-checker-share__input:focus {
        background-color: #1f2937;
    }
    
    .kitchor-text-checker-version-banner {
        color: #93c5fd;
        background-color: #1e3a5f;
        border-color: #1e40af;
    }
}
