/* Estilos para componentes de autenticación */

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

.user-btn {
    background: none;
    border: none;
    color: var(--text-color, #333);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

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

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 5px;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

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

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: #666;
}

.dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 8px 0;
}

/* Auth modal improvements */
.auth-modal {
    z-index: 10000;
}

.auth-modal .modal-content {
    max-width: 400px;
    width: 90%;
    margin: 0 auto;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.auth-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.auth-form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.auth-form-group input.error {
    border-color: #dc3545;
}

.auth-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.auth-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-error i {
    color: #dc3545;
}

.auth-success {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-success i {
    color: #28a745;
}

.auth-loading {
    text-align: center;
    padding: 40px 20px;
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.auth-switch button {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
}

.auth-switch button:hover {
    color: #0056b3;
}

/* Responsive design */
@media (max-width: 768px) {
    .user-dropdown-menu {
        right: -10px;
        min-width: 180px;
    }
    
    .user-name {
        max-width: 100px;
    }
    
    .auth-modal .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .user-btn {
        color: #fff;
    }
    
    .user-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .user-dropdown-menu {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .dropdown-item {
        color: #e2e8f0;
    }
    
    .dropdown-item:hover {
        background-color: #4a5568;
    }
    
    .dropdown-item i {
        color: #a0aec0;
    }
    
    .dropdown-divider {
        background-color: #4a5568;
    }
}