/**
 * Social Login Frontend Styles
 *
 * @package SugarTube
 */

.sugartube-social-login {
    margin: 20px 0;
    text-align: center;
}

.social-login-divider {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.social-login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.social-login-divider span {
    background: #fff;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.social-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 10px;
}

.social-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-login-btn:active {
    transform: translateY(0);
}

.social-login-btn svg {
    flex-shrink: 0;
}

/* Gmail Button */
.gmail-btn {
    border-color: #dadce0;
    color: #3c4043;
}

.gmail-btn:hover {
    border-color: #c2c7c8;
    background: #f8f9fa;
}

.gmail-btn:active {
    background: #f1f3f4;
}

/* Twitter Button */
.twitter-btn {
    border-color: #1da1f2;
    color: #1da1f2;
}

.twitter-btn:hover {
    border-color: #1a91da;
    background: #f0f8ff;
}

.twitter-btn:active {
    background: #e6f4ff;
}

/* Facebook Button */
.facebook-btn {
    border-color: #1877f2;
    color: #1877f2;
}

.facebook-btn:hover {
    border-color: #166fe5;
    background: #f0f3ff;
}

.facebook-btn:active {
    background: #e6ecff;
}

/* Loading state */
.social-login-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.social-login-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.social-login-btn.error {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

/* Success state */
.social-login-btn.success {
    border-color: #28a745;
    color: #28a745;
    background: #f8fff8;
}

/* Responsive styles */
@media screen and (max-width: 480px) {
    .social-login-btn {
        max-width: 100%;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .social-login-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .social-login-divider span {
        background: #1e1e1e;
        color: #ccc;
    }
    
    .social-login-divider::before {
        background: #444;
    }
    
    .gmail-btn {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .gmail-btn:hover {
        background: #3d3d3d;
        border-color: #555;
    }
    
    .twitter-btn:hover {
        background: #1a3a52;
    }
    
    .facebook-btn:hover {
        background: #1a2a4a;
    }
}

/* Integration with existing forms */
.login form .sugartube-social-login,
.register-form .sugartube-social-login {
    margin-top: 20px;
}

/* Custom login page styles */
.sugartube-login-page .sugartube-social-login {
    max-width: 400px;
    margin: 30px auto;
}

.sugartube-login-page .social-login-btn {
    width: 100%;
}

/* Modal styles */
.modal .sugartube-social-login {
    padding: 0 20px;
}

.modal .social-login-btn {
    max-width: none;
}

/* Button group layout */
.social-login-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media screen and (min-width: 768px) {
    .social-login-btn-group {
        flex-direction: row;
        gap: 15px;
    }
    
    .social-login-btn-group .social-login-btn {
        flex: 1;
    }
}

/* Tooltip for provider info */
.social-login-btn[title] {
    position: relative;
}

.social-login-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.social-login-btn[title]:hover::after {
    opacity: 1;
}

/* Accessibility improvements */
.social-login-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.social-login-btn:focus:not(:focus-visible) {
    outline: none;
}

.social-login-btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .social-login-btn {
        border-width: 2px;
        font-weight: 600;
    }
    
    .social-login-btn:hover {
        border-width: 3px;
    }
}
