/* Social Authentication Buttons - Modern Mobile-First Design */
.social-login-section {
    margin: 24px 0 16px;
    padding: 0;
}

.social-login-divider {
    text-align: center;
    margin: 24px 0 20px;
    position: relative;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-login-divider::before,
.social-login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 25px);
    height: 1px;
    background: #e5e7eb;
}

.social-login-divider::before {
    left: 0;
}

.social-login-divider::after {
    right: 0;
}

.social-login-divider span {
    background: #ffffff;
    padding: 0 12px;
    position: relative;
    z-index: 1;
}

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Modern Social Login Button Base */
.social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    letter-spacing: 0.25px;
}

/* Active state for better touch feedback */
.social-login-btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.social-login-btn svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
    display: inline-block;
}

/* Apple Button - Primary on iOS */
.social-login-btn.apple {
    background: #000;
    color: #fff;
    font-weight: 500;
    letter-spacing: -0.2px;
    display: none; /* Hidden by default, shown via JS on iOS */
}

.social-login-btn.apple:hover {
    background: #1a1a1a;
}

.social-login-btn.apple:active {
    background: #000;
}

/* Google Sign-In Button - Official Design Guidelines */
.social-login-btn.google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    font-weight: 500;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.social-login-btn.google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 2px 6px 2px rgba(60,64,67,0.15);
}

.social-login-btn.google:active {
    background: #e8eaed;
    border-color: #dadce0;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.30), 0 2px 6px 2px rgba(60,64,67,0.15);
}

/* Facebook Login Button - Official Brand Guidelines */
.social-login-btn.facebook {
    background: #1877f2;
    color: #ffffff;
    border: none;
    font-weight: 600;
    font-family: Helvetica, Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.social-login-btn.facebook:hover {
    background: #166fe5;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.social-login-btn.facebook:active {
    background: #145dbf;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: scale(0.98);
}

/* Email Secondary Option */
.social-login-btn.email-secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    font-size: 15px;
    font-weight: 400;
    min-height: 44px;
    margin-top: 8px;
}

.social-login-btn.email-secondary:hover {
    background: #f8f9fa;
    color: #1a1a1a;
    border-color: #d1d5db;
}

.social-login-btn.email-secondary:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Google icon - allow original size for proper branding */
.social-login-btn.google svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Facebook icon */
.social-login-btn.facebook svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Hide any duplicate Google branding */
.social-login-btn.google::before,
.social-login-btn.google::after {
    display: none !important;
}

/* Ensure button content is properly laid out */
.social-login-btn span {
    font-size: 15px;
    line-height: 1;
}

/* Social connection status */
.social-connections {
    margin-top: 20px;
}

.social-connection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.social-connection.connected {
    border-color: #4caf50;
}

.social-connection-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-connection-status {
    font-size: 14px;
    color: #4caf50;
}

.social-disconnect-btn {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-disconnect-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile-First Optimizations */
@media (max-width: 768px) {
    .social-login-section {
        margin: 20px -20px 12px;
        padding: 0 20px;
    }
    
    .social-login-divider {
        margin: 16px 0 12px;
        font-size: 12px;
    }
    
    .social-login-buttons {
        gap: 8px;
    }
    
    .social-login-btn {
        min-height: 52px;
        font-size: 17px;
        border-radius: 14px;
        letter-spacing: -0.2px;
    }
    
    /* Keep icons consistent size on mobile */
    .social-login-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* iOS-specific styles */
    @supports (-webkit-touch-callout: none) {
        .social-login-btn {
            font: -apple-system-body;
            -webkit-font-smoothing: antialiased;
        }
        
        .social-login-btn.apple {
            display: flex;
            order: -1; /* Show Apple first on iOS */
        }
    }
}

/* Small phones */
@media (max-width: 375px) {
    .social-login-btn {
        font-size: 16px;
        padding: 13px 16px;
    }
    
    .social-login-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Landscape orientation optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .social-login-section {
        margin: 12px 0 8px;
    }
    
    .social-login-buttons {
        gap: 6px;
    }
    
    .social-login-btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 15px;
    }
}

/* Touch States and Loading Animations */
.social-login-btn.touching {
    transform: scale(0.97);
    opacity: 0.9;
}

.social-login-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.social-login-btn.loading span {
    opacity: 0.7;
}

.social-spinner {
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Mobile-specific form adjustments */
.mobile-view .social-login-section {
    position: sticky;
    bottom: 0;
    background: #1b2434;
    padding: 16px 20px 20px;
    margin: 20px -20px -20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

/* Safe area insets for modern phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-view .social-login-section {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .social-login-btn.google {
        background: #131314;
        color: #e8eaed;
        border: 1px solid #5f6368;
    }
    
    .social-login-btn.google:hover {
        background: #202124;
        border-color: #8ab4f8;
    }
    
    .social-login-btn.google svg path {
        fill: #8ab4f8;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .social-login-btn {
        transition: none;
    }
    
    .social-spinner {
        animation: none;
        opacity: 0.6;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .social-login-btn {
        border: 2px solid currentColor;
    }
    
    .social-login-btn:focus {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* Native-style press animation */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

.social-login-btn:active {
    animation: buttonPress 0.15s ease-out;
}

/* Smooth entry animation for mobile */
@media (max-width: 768px) {
    .social-login-section {
        animation: slideUp 0.3s ease-out;
    }
    
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Stagger button animations */
    .social-login-btn {
        opacity: 0;
        animation: fadeInButton 0.4s ease-out forwards;
    }
    
    .social-login-btn:nth-child(1) { animation-delay: 0.1s; }
    .social-login-btn:nth-child(2) { animation-delay: 0.15s; }
    .social-login-btn:nth-child(3) { animation-delay: 0.2s; }
    .social-login-btn:nth-child(4) { animation-delay: 0.25s; }
    
    @keyframes fadeInButton {
        to {
            opacity: 1;
            transform: translateY(0);
        }
        from {
            opacity: 0;
            transform: translateY(10px);
        }
    }
}

/* Focus indicators for accessibility */
.social-login-btn:focus-visible {
    outline: 2px solid #0057ff;
    outline-offset: 2px;
}

/* Platform-specific button order */
@supports (-webkit-touch-callout: none) {
    /* iOS - Apple first */
    .social-login-btn.apple { order: 1; }
    .social-login-btn.google { order: 2; }
    .social-login-btn.facebook { order: 3; }
    .social-login-btn.email-secondary { order: 4; }
}

@supports not (-webkit-touch-callout: none) {
    /* Android - Google first */
    .social-login-btn.google { order: 1; }
    .social-login-btn.facebook { order: 2; }
    .social-login-btn.apple { order: 3; }
    .social-login-btn.email-secondary { order: 4; }
}