/* Authentication Styles - Modern Google Sign-in Button */

/* Google Sign-in Button */
.google-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.1);
    min-height: 36px;
    max-height: 36px;
    white-space: nowrap;
    vertical-align: middle;
}

.google-signin-btn:hover {
    background: #f8f9fa;
    border-color: #c8cbcf;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15), 0 1px 4px rgba(60, 64, 67, 0.3);
    transform: translateY(-1px);
}

.google-signin-btn:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
    transform: translateY(0);
}

.google-signin-btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* Google Icon */
.google-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .google-signin-btn {
        padding: 14px 20px;
        font-size: 16px; /* Prevent zoom on iOS */
        gap: 10px;
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .google-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .google-signin-btn {
        padding: 16px 18px;
        font-size: 15px;
    }
    
    .google-signin-btn span {
        font-size: 15px;
    }
}

/* Compact version for smaller spaces */
.google-signin-btn.compact {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
    max-height: 32px;
    gap: 6px;
}

.google-signin-btn.compact .google-icon {
    width: 14px;
    height: 14px;
}

.google-signin-btn.compact span {
    font-size: 12px;
    font-weight: 500;
}

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

.google-signin-btn.loading .google-icon {
    animation: spin 1s linear infinite;
}

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

/* Auth buttons container */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .auth-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        align-items: stretch;
    }
}

/* Integration with existing nav styles */
.nav-auth .google-signin-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    gap: 6px !important;
}

.nav-auth .google-signin-btn:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
}

.nav-auth .google-signin-btn .google-icon {
    width: 14px !important;
    height: 14px !important;
}

.nav-auth .google-signin-btn span {
    font-size: 12px !important;
    font-weight: 500;
}


/* Add styles for nav-auth alignment */
.nav-auth {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-right-items {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .nav-right-items {
        display: none; /* Already hidden in other files, but good for consistency */
    }

    .nav-auth-mobile .google-signin-btn {
        width: auto; /* Let it size naturally */
        padding: 10px 16px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .google-signin-btn {
        background: #2d2d30;
        color: #e8eaed;
        border-color: #5f6368;
    }
    
    .google-signin-btn:hover {
        background: #353538;
        border-color: #8ab4f8;
    }
    
    .google-signin-btn:active {
        background: #292a2d;
    }
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .google-signin-btn,
    .google-icon {
        transition: none;
        animation: none;
    }
}

/* Mobile Navigation Auth Styles */
.nav-auth-mobile .google-signin-btn {
    width: 100%;
    margin: 12px 0;
    padding: 14px 20px;
    justify-content: center;
}

.nav-auth-mobile .google-signin-btn span {
    font-size: 16px;
    font-weight: 500;
}

/* Logout link styling */
.logout-link {
    color: #dc3545 !important;
}

.logout-link:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Better mobile touch targets */
@media (max-width: 768px) {
    .nav-auth .google-signin-btn {
        min-height: 36px !important; /* Compact for mobile nav */
        max-height: 36px !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    .nav-auth-mobile .google-signin-btn {
        min-height: 44px; /* Better touch target for mobile menu */
        font-size: 14px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
}

/* Override any conflicting button styles */
button.google-signin-btn {
    border: 1px solid #dadce0 !important;
    background: white !important;
    color: #3c4043 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
}

button.google-signin-btn:hover {
    background: #f8f9fa !important;
    border-color: #c8cbcf !important;
}

/* Ensure proper sizing in navigation */
.navbar .google-signin-btn {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Override any generic button styles that might interfere */
.google-signin-btn.google-signin-btn {
    /* Double class for higher specificity */
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    border-radius: 6px !important;
    gap: 6px !important;
    background: white !important;
    color: #3c4043 !important;
    border: 1px solid #dadce0 !important;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.1) !important;
    transform: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    position: relative !important;
}

.google-signin-btn.google-signin-btn::before {
    display: none !important; /* Remove any pseudo-elements */
}

.google-signin-btn.google-signin-btn:hover {
    background: #f8f9fa !important;
    border-color: #c8cbcf !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(60, 64, 67, 0.15) !important;
}

/* Navigation-specific overrides */
.nav-auth .google-signin-btn.google-signin-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.nav-auth .google-signin-btn.google-signin-btn:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}