/**
 * Frontend styles for CC Social Login
 */

/* Social Login Wrapper */
.cc-social-login-wrapper {
    margin: 0 0 20px 0;
    padding-top: 30px;
    text-align: center;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 20px;
}

.cc-social-login-wrapper h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* Hide duplicate social login sections */
.cc-social-login-wrapper + .cc-social-login-wrapper,
.cc-social-login-buttons + .cc-social-login-buttons {
    display: none !important;
}

/* Social Login Buttons Container */
.cc-social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.cc-social-login-buttons.cc-social-login-style-minimal {
    max-width: 250px;
}

.cc-social-login-buttons.cc-social-login-style-large {
    max-width: 350px;
}

/* Individual Social Login Button */
.cc-social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Google-specific button styling */
.cc-social-login-btn.cc-social-login-google {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    letter-spacing: 0.25px;
}

.cc-social-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.cc-social-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cc-social-login-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Button Icon */
.cc-social-login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cc-social-login-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}

/* Google icon specific styling */
.cc-social-login-google .cc-social-login-icon svg {
    width: 20px;
    height: 20px;
    fill: none; /* Let the SVG use its own colors */
}

/* Fallback for Google icon if SVG doesn't load */
.cc-social-login-google .cc-social-login-icon::before {
    content: "G";
    font-weight: bold;
    font-size: 16px;
    color: #4285F4;
    display: none; /* Hidden by default, shown if SVG fails */
}

/* Show fallback when SVG is not present or empty */
.cc-social-login-google .cc-social-login-icon:not(:has(svg)) .google-fallback-text,
.cc-social-login-google .google-fallback-text {
    display: inline-block !important;
    font-size: 18px;
    font-weight: bold;
    color: #4285F4;
    margin-right: 8px;
}

.cc-social-login-google .cc-social-login-icon svg + .google-fallback-text {
    display: none !important;
}

/* Button Text */
.cc-social-login-text {
    flex: 1;
    text-align: center;
}

/* Specific Provider Styles */
.cc-social-login-google {
    background-color: #ffffff !important;
    color: #757575 !important;
    border: 1px solid #dadce0 !important;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,.25);
}

.cc-social-login-google:hover {
    background-color: #f8f9fa !important;
    color: #3c4043 !important;
    border-color: #dadce0 !important;
    box-shadow: 0 1px 3px 1px rgba(60,64,67,.15);
    transform: none; /* Override default transform for Google button */
}

.cc-social-login-facebook {
    background-color: #3b5998;
}

.cc-social-login-facebook:hover {
    background-color: #2d4373;
}

.cc-social-login-amazon {
    background-color: #ff9900;
}

.cc-social-login-amazon:hover {
    background-color: #e68a00;
}

/* Button Style Variations */

/* Minimal Style */
.cc-social-login-style-minimal .cc-social-login-btn {
    padding: 10px 15px;
    font-size: 13px;
    min-height: 40px;
}

.cc-social-login-style-minimal .cc-social-login-icon {
    width: 16px;
    height: 16px;
}

.cc-social-login-style-minimal .cc-social-login-icon svg {
    width: 14px;
    height: 14px;
}

/* Large Style */
.cc-social-login-style-large .cc-social-login-btn {
    padding: 15px 25px;
    font-size: 16px;
    min-height: 50px;
}

.cc-social-login-style-large .cc-social-login-icon {
    width: 24px;
    height: 24px;
}

.cc-social-login-style-large .cc-social-login-icon svg {
    width: 22px;
    height: 22px;
}

/* Divider */
.cc-social-login-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.cc-social-login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e1e1e1;
}

.cc-social-login-divider span {
    background-color: white;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* Loading State */
.cc-social-login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.cc-social-login-btn.loading .cc-social-login-text::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% {
        color: transparent;
        text-shadow: 0.25em 0 0 currentColor, 0.5em 0 0 transparent, 0.75em 0 0 transparent;
    }
    40% {
        color: transparent;
        text-shadow: 0.25em 0 0 transparent, 0.5em 0 0 currentColor, 0.75em 0 0 transparent;
    }
    60% {
        color: transparent;
        text-shadow: 0.25em 0 0 transparent, 0.5em 0 0 transparent, 0.75em 0 0 currentColor;
    }
    80%, 100% {
        color: transparent;
        text-shadow: 0.25em 0 0 transparent, 0.5em 0 0 transparent, 0.75em 0 0 transparent;
    }
}

/* Error Messages */
.cc-social-login-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

/* Success Messages */
.cc-social-login-success {
    background-color: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .cc-social-login-buttons {
        max-width: 100%;
    }
    
    .cc-social-login-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .cc-social-login-wrapper {
        margin: 15px 0;
    }
}

/* WooCommerce Integration */
.woocommerce .cc-social-login-wrapper {
    margin-bottom: 30px;
}

.woocommerce-form-login .cc-social-login-buttons {
    margin-bottom: 20px;
}

/* RTL Support */
body.rtl .cc-social-login-btn {
    text-align: center;
}

body.rtl .cc-social-login-text {
    text-align: center;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cc-social-login-btn {
        border: 2px solid white;
    }
    
    .cc-social-login-btn:focus {
        outline: 3px solid #ffff00;
        outline-offset: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cc-social-login-btn {
        transition: none;
    }
    
    .cc-social-login-btn:hover {
        transform: none;
    }
    
    @keyframes loading-dots {
        to {
            opacity: 0.5;
        }
    }
}