/**
 * Authentication-related styles for EarningsIQ
 * This file contains styles for authentication UI elements including
 * error messages, user dropdown menu, authenticated state displays,
 * and notification system.
 */

/* Auth Error Messages */
.auth-error {
    color: #e53935;
    background-color: rgba(229, 57, 53, 0.1);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

/* User Dropdown Menu */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.user-dropdown-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-dropdown-toggle .dropdown-caret {
    margin-left: 6px;
    font-size: 12px;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

/* Mobile User Menu */
.user-greeting {
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    color: #333;
}

/* Auth State Display */
[data-auth-state] {
    transition: opacity 0.3s ease;
}

/* Auth Loading State - Prevents flicker */
body.auth-loading .user-dropdown,
body.auth-loading [data-auth-state] {
    transition: none !important; /* Disable transitions during loading */
}

/* Ensure smooth transitions after authentication is determined */
body:not(.auth-loading) [data-auth-state] {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Loading Spinner */
.auth-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: auth-spinner 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes auth-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    padding: 15px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: slide-in 0.3s ease-out forwards;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification.success {
    background-color: #4caf50;
}

.notification.error {
    background-color: #f44336;
}

.notification.info {
    background-color: #2196f3;
}

.notification-close {
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

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

/* Google Button Styling */
.google-signin {
    background-color: #fff;
    color: #757575;
    border: 1px solid #ddd;
}

.google-signin:hover {
    background-color: #f8f8f8;
}

/* Disabled Social Buttons */
.social-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}
