/* Email Widget Styles */
.email-widget {
    position: fixed;
    right: 20px;
    bottom: 80px; /* Increased spacing from bottom */
    z-index: 10000; /* Higher z-index to ensure visibility */
    transition: all 0.3s ease;
}

.email-icon {
    width: 60px;
    height: 60px;
    background: #EA4335; /* Gmail red color */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(234, 67, 53, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.email-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(234, 67, 53, 0.6);
}

.email-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
}

/* Pulse animation */
.email-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: #EA4335;
    animation: email-pulse 2s infinite;
    z-index: -1;
}

@keyframes email-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    70% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Tooltip */
.email-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.email-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: #1f2937;
}

.email-widget:hover .email-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-5px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .email-widget {
        right: 15px;
        bottom: 60px; /* Reduced spacing for better mobile layout */
    }
    
    .email-icon {
        width: 50px;
        height: 50px;
    }
    
    .email-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .email-tooltip {
        font-size: 12px;
        padding: 8px 12px;
        right: 60px;
    }
}

@media (max-width: 480px) {
    .email-widget {
        right: 10px;
        bottom: 45px; /* Further reduced for small screens */
    }
    
    .email-icon {
        width: 45px;
        height: 45px;
    }
    
    .email-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .email-tooltip {
        font-size: 11px;
        padding: 6px 10px;
        right: 55px;
    }
}

@media (max-width: 360px) {
    .email-widget {
        right: 8px;
        bottom: 30px; /* Even tighter spacing for very small screens */
    }
    
    .email-icon {
        width: 40px;
        height: 40px;
    }
    
    .email-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .email-tooltip {
        background: #374151;
        border: 1px solid #4b5563;
    }
    
    .email-tooltip::after {
        border-left-color: #374151;
    }
}

/* Animation for entrance */
.email-widget {
    animation: email-slide-in 0.5s ease-out;
}

@keyframes email-slide-in {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Notification badge (optional) */
.email-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF5722;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-bounce 2s infinite;
}

@keyframes badge-bounce {
    0%, 50%, 100% {
        transform: scale(1);
    }
    25%, 75% {
        transform: scale(1.1);
    }
}
