/**
 * WooCommerce Social Login - Frontend Styles
 * Optimized for performance and modern design
 */

/* Main container */
.wsl-social-login {
    margin: 2em 0 !important;
    text-align: center !important;
    clear: both !important;
}

/* Separator */
.wsl-separator {
    position: relative !important;
    margin: 1.5em 0 !important;
    text-align: center !important;
    color: #646970 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.wsl-separator span {
    background: #fff !important;
    padding: 0 16px !important;
    position: relative !important;
    z-index: 1 !important;
}

.wsl-separator:before {
    content: '' !important;
    display: block !important;
    width: 100% !important;
    height: 1px !important;
    background-color: #ddd !important;
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    z-index: 0 !important;
}

/* Buttons container */
.wsl-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 1.5em 0 !important;
}

/* Individual provider buttons */
.wsl-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 24px !important;
    border: 1px solid #ddd !important;
    background-color: #fff !important;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    transition: all .2s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.08) !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    min-height: 50px !important;
}

.wsl-button:hover {
    background-color: #f9f9f9 !important;
    border-color: #bbb !important;
    color: #111 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 8px rgba(0,0,0,.12) !important;
    transform: translateY(-2px) !important;
}

.wsl-button:active {
    background-color: #f0f0f0 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.1) !important;
    transform: translateY(0) !important;
}

/* Icons */
.wsl-button .wsl-icon {
    width: 22px !important;
    height: 22px !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
}

/* Provider-specific button styles */
.wsl-button-facebook {
    background-color: #1877f2 !important;
    border-color: #1877f2 !important;
    color: #fff !important;
}
.wsl-button-facebook:hover {
    background-color: #166fe5 !important;
    border-color: #166fe5 !important;
    color: #fff !important;
}

.wsl-button-google {
    background-color: #fff !important;
    border-color: #dadce0 !important;
    color: #3c4043 !important;
}
.wsl-button-google:hover {
    background-color: #f8f9fa !important;
    border-color: #d2e3fc !important;
    color: #3c4043 !important;
}

.wsl-button-apple {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
}
.wsl-button-apple:hover {
    background-color: #1d1d1f !important;
    border-color: #1d1d1f !important;
    color: #fff !important;
}

.wsl-button-microsoft {
    background-color: #fff !important;
    border-color: #8c8c8c !important;
    color: #5e5e5e !important;
}
.wsl-button-microsoft:hover {
    background-color: #f3f3f3 !important;
    border-color: #8c8c8c !important;
    color: #5e5e5e !important;
}

.wsl-button-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
    border: 0 !important;
    color: #fff !important;
}
.wsl-button-instagram:hover {
    opacity: .9 !important;
    color: #fff !important;
}

.wsl-button-discord {
    background-color: #5865f2 !important;
    border-color: #5865f2 !important;
    color: #fff !important;
}
.wsl-button-discord:hover {
    background-color: #4752c4 !important;
    border-color: #4752c4 !important;
    color: #fff !important;
}

.wsl-button-twitter {
    background-color: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
}
.wsl-button-twitter:hover {
    background-color: #1d1d1f !important;
    border-color: #1d1d1f !important;
    color: #fff !important;
}

.wsl-button-amazon {
    background-color: #ff9900 !important;
    border-color: #ff9900 !important;
    color: #fff !important;
}
.wsl-button-amazon:hover {
    background-color: #ec8b00 !important;
    border-color: #ec8b00 !important;
    color: #fff !important;
}

.wsl-button-linkedin {
    background-color: #0077b5 !important;
    border-color: #0077b5 !important;
    color: #fff !important;
}
.wsl-button-linkedin:hover {
    background-color: #006399 !important;
    border-color: #006399 !important;
    color: #fff !important;
}

/* Checkout specific styles */
.wsl-social-login-checkout {
    margin: 0 0 1.5em;
    padding: 1.5em;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.wsl-social-login-checkout .wsl-buttons {
    margin: 1em 0 0;
}

/* My Account page specific styles */
.woocommerce-social-login-linked-accounts {
    margin: 2em 0;
    padding: 1.5em;
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.woocommerce-social-login-accounts {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.woocommerce-social-login-accounts th,
.woocommerce-social-login-accounts td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce-social-login-accounts th {
    font-weight: 600;
    color: #333;
}

.wsl-provider-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wsl-status-connected {
    color: #28a745;
    font-weight: 500;
}

.wsl-status-not-connected {
    color: #6c757d;
}

/* Responsive styles */
@media (min-width: 481px) {
    .wsl-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .wsl-button {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .wsl-button {
        width: 100%;
    }
}

/* Loading state */
.wsl-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.wsl-loading:after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wsl-spin 0.8s ease-in-out infinite;
    vertical-align: middle;
}

.wsl-button-facebook .wsl-loading:after,
.wsl-button-apple .wsl-loading:after {
    border-top-color: #fff;
}

.wsl-button-google .wsl-loading:after,
.wsl-button-microsoft .wsl-loading:after {
    border-top-color: #333;
}

@keyframes wsl-spin {
    to { transform: rotate(360deg); }
}

/* Error messages */
.wsl-error {
    color: #dc3232;
    margin: 1em 0;
    padding: 0.5em 1em;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Success messages */
.wsl-success {
    color: #155724;
    margin: 1em 0;
    padding: 0.5em 1em;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

/* Privacy policy text */
.wsl-privacy-policy-text {
    margin-top: 1em;
    font-size: 0.85em;
    color: #6c757d;
    line-height: 1.5;
}

.wsl-privacy-policy-text a {
    color: #2271b1;
    text-decoration: none;
}

.wsl-privacy-policy-text a:hover {
    text-decoration: underline;
}
